I am starting a collection of usability issues and possible best-practice workarounds:
Issues:
How to create “static” sites in a template like disclaimer, contact, privacy, impressum.
How to use markdown in Theme-templates / index.html
How to use shortcodes in templates / index.html
Sollution:
Best practice:
1.1 Use “_index.md” files like “privacy/_index.md” with an optional archetype “privacy.md” to configure it and an template “layouts/section/privacy.html” to render the page. This will result in a static site located at “privacy/index.html” which can be modified by using the config “permalink” (my own suggestion)
I’m curious to hear why this is a ‘best practice’. Is ‘best’ implying that this is how most people should approach it? It sounds a bit overkill to create a specific section template for privacy (and presumably for disclaimer, contact, impressum, terms and conditions too). That are 5 different section templates for content that’s much the same. I personally prefer to use the /layouts/page/single.html template file for that content, since it saves me replicating nearly identical templates.
The ‘use index.html files’ seems a bit redundant to me, since Hugo already generates content files into html files. That is, the privacy.md file in the root of /content/ renders as /privacy/index.html. (Unless with ugly permalinks.)
I forgot to write behind that that this is my own suggestion to solve this issue. I just wrote it. And I had a mistake in it which I corrected. I wanted to write “_index.md”.
I used different section templates because how I meant that issue is that there shouldn’t be anything else than configuring a few values in the md-files which means that the whole page with its content is created in the template file itself to prevent redudancy between projects (writing the same privacy terms and disclaimers in every project again and again (.md way to go) instead of having it inside the template itself).
I would be happy about your thoughts about the edit and clarification and if your way of solving it is still applicable.