Flutter-Bounty-Hunters / static_shock

A static site generator for Dart.
MIT License
107 stars 5 forks source link

[CLI] - Created a template for a documentation website (Resolves #4) #112

Closed matthew-carroll closed 4 months ago

matthew-carroll commented 4 months ago

[CLI] - Created a template for a documentation website (Resolves #4)

Still need support for Algolia search in the template.

Includes support for:

Screenshot 2024-05-08 at 3 44 35 PM Screenshot 2024-05-08 at 3 44 42 PM

Added working CLI tests for the docs template generation.

Source code includes the following template sections:

/packages/template_docs -> the source of truth for the docs template, in a runnable state

/packages/static_shock_cli/templates/docs -> the docs template with mustache variables for Mason

/packages/static_shock_cli/lib/templates/docs.bundle -> the final bundled docs template that's inflated at runtime

Future templates will need the same pieces as above.

The process for updating a template is as follows:

  1. Alter the runnable template (e.g., /packages/template_docs) until it behaves as intended.
  2. Copy the runnable source files (e.g., /packages/template_docs) to the template source (e.g., /packages/static_shock_cli/templates/docs). Replace all hard-coded values with mustache variables. Replace all Jinja brackets with escaped versions: {{#mustacheCase}} stuff {{/mustacheCase}}
  3. Run mason bundle to create a new bundle from the template source. Move that bundle into /packages/static_shock_cli/lib/templates/.
matthew-carroll commented 4 months ago

FYI @angelosilvestre