Statiq.Web
Statiq.Web copied to clipboard
Support for archetypes/templates
Similar to Hugo archetypes, will tie into new CLI. One important point - archetypes should be definable both in code (I.e., by extensions) as well as the file system. A new API needs to be provided to register them from code.
They'll get registered in the following order, any duplicate names overwriting the content before:
- Built-in templates (
post
,page
, etc.) - Extensions
- File system
The folder where they're placed should default to something like /templates
but additional/alternate folders could be specified in the CLI config file.
Some thoughts:
- Should use a lightweight, no dependency templating system - maybe just good old string interpolation (I.e. wrap the archetype file in a
$"..."
and compile/run. - CLI option to create a new branch.
- CLI option to open an editor to the new file.
- Ability to pass arbitrary CLI arguments to the template.
Some great inspiration at https://github.com/phil-scott-78/thirty25-statiq/blob/main/Statiq.Helpers/NewPostCommand.cs