fermyon / bartholomew

The Micro-CMS for WebAssembly and Spin
https://bartholomew.fermyon.dev/
Apache License 2.0
413 stars 50 forks source link

Create dynamic template feature #161

Open tpmccallum opened 1 year ago

tpmccallum commented 1 year ago

At present, each .md file can only have one static .hbs file referenced in the frontmatter.

It would be great to have dynamic templates instead of hard-coded templates, per .md file.

See this link in developer docs for more information.

karthik2804 commented 1 year ago

How would the template be specified dynamically? One of the ways I can imagine is through request parameters.

tpmccallum commented 1 year ago

That is what I was also thinking; if a user clicks on a link from a page in the site that uses a specific template i.e. after clicking they arrive at a new page (from template_1.hbs). No matter what page they have just landed on, the arrival at the new page is rendered using that same template_1.hbs (and not the .hbs that is typed into the frontmatter).

tpmccallum commented 1 year ago

If leaving the original hard-coded .hbs template name in the frontmatter is possible (as part of this upgrade) then this would be a really quick update for the developer documentation (would not have to update every .md files frontmatter). But I understand if each .md needs to have a dynamic value in place of that original hard-coded value. Still thinking at this stage so any ideas are welcome :)

tpmccallum commented 1 year ago

This has been resolved via PR #616