StellarSt0rm's Cozy Website


Repo: https://codeberg.org/stellarst0rm/static-website-generator

Static Website Generator is a templating engine, and while its name says otherwise it theoretically should handle any templating work, simple work that is. Initially I made it to create my website (The one you're reading this on!), but from the start I made it quite generic, all it does is interpret expressions and fill them in, you could use it to template JSON, Markdown, etc.

I do plan on making it more flexible for non-website workflows, and add new features and improvements, the most recent improvements that are in the works at the time of writing this (April 16) is improving the parser to make it simpler and nicer to work with within the code and array types for the if and data rule. For the if rule the arrays will allow me to combine the eq/ne ghost rules1 into ifeq and ifne. And for the data rule allow multiple data sources and even exclusions with !path.extension.

There's many rules, but mainly there's two types of rules, global rules and normal rules, global rules can be paired with any other global rule2 and normal rule, normal rules cannot be paired with themselves. Global rules modify the output of the expression, for example post applies a postprocessor and link changes where the rule output goes, and normal rules produce said output, for example the file rule reads a file, the text rule adds its value as plain text, and tmpl brings in a template from a file.

Footnotes

  1. These rules get ignored by the rest of the program and filtered out, the if rule then searches for them, if you only use eq and ne rules then no error will be raised.

  2. When i add arrays, then some global rules will be incompatible with each other, specifically the ifeq and ifne rules.