v79 / Cantilever

Creating a cloud-first static website generator using AWS servers such as S3 and Lambda. Transforms markdown files into HTML.
2 stars 0 forks source link

Project definition file #25

Closed v79 closed 12 months ago

v79 commented 1 year ago

A lot of values are currently hard-coded, such as folder paths. And there's nowhere to store project-level values such as website names.

Definite a project.yaml file. Create route for editing the project defintion, and a web UI for this. Create a UI for starting a new project.

v79 commented 1 year ago

Possible content for the project yaml file (probably call it cantilever.yaml to avoid confusion with previous meanings of the word 'project' across the project).

Something like:

projectName: Cantilever Devlog
dateFormat: dd/MM/yyyy
dateTimeFormat: HH:mm:ss dd/MM/yyyy
author: Liam Davison
imageResolutions: ["640x480","1024x768","500x","x360"] # If the X or Y dimension is missing, then keep the existing aspect ratio when scaling
$postsPerPage: 10 # custom property which will passed to the parameter map for page generation, parsed to a number if practical
v79 commented 1 year ago

Example content from Bascule yaml file:

siteName: Liam John Davison
dateFormat: "dd/MM/yyyy"
dateTimeFormat: HH:mm:ss dd/MM/yyyy
author: Liam Davison
theme: liamjd-theme
postsPerPage: 10
host: http://www.liamjd.org/
postLayouts: [devlog,post]

directories:
  source: sources
  output: site
  assets: assets
  templates: liamjd-theme/templates
  custom:
    posts: posts
    pdf: pdf
    pdfTemplates: liamjd-theme/templates/fop
s3:
  bucket: ljdtesting
generators: [IndexPageGenerator, PostNavigationGenerator, MultiTaxonomyNavigationGenerator, org.liamjd.bascule.extra.generators.sitemap.SitemapXMLGenerator, org.liamjd.bascule.extra.generators.lunr.LunrJSIndexGenerator]
extensions: [ ]
# org.liamjd.bascule.flexmark.spotify.SpotifyExtension
# org.liamjd.bascule.extra.generators.aws.s3.S3BucketUpload
# org.liamjd.bascule.extra.generators.pdf.SitePDFGenerator
$debug: false
v79 commented 12 months ago

Rather than custom attributes having a $ prefix, it looks simpler to have a defined property called "attributes" which is a Map<String,String>. I'll make it nullable and optional.