Statiq.Web icon indicating copy to clipboard operation
Statiq.Web copied to clipboard

Support for archetypes/templates

Open daveaglick opened this issue 6 years ago • 1 comments

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.

daveaglick avatar Aug 09 '18 14:08 daveaglick

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

daveaglick avatar Jan 20 '21 18:01 daveaglick