I have been working on the Nederburg for a while and finally have time to resolve some outstanding issues. At the same time I am trying to learn more about Hugo.
The issue I am working is to create a different style page from the regular post single.html for about and contact pages. Currently the contact page renders correctly with a form, but the about page is using the regular post single. The content directory structure is:
and the theme layouts folder is this, which is not working correctly and I cannot figure out how to set it up correctly based on Template Lookup Order.
I have tried renaming about/single.html to list.html but that didn’t work unless I also rename content/about/index.md to _index.md. I feel like I am close to a solution but don’t know the right way to do it.
An index.md page uses a single template, and an _index.md page uses a list template.
Since your about page lives at the content root dir it’s just considered a regular page. So you’ll need to explicitly tell it to use the about single template.
In the front matter of your about page try setting
Thanks Leo, that post will take a bit for me to wrap my head around. It seams like a lot of the themes could use a revamp to take advantage of these features. Is there a “current theme” that is kept up to date and uses the latest features and directory structure?
Which means your about page is technically living under the content root section, which will use template layouts/_default/single.html, unless specified otherwise via front matter (as in my example above).
Now, let’s say you had a file like this
content/about/some-page.md
Then this page would use the layouts/about/single.html template by default.
Well, when you say it like that it makes perfect sense! Thank you.
Also, changing the front matter and renaming a few files resolved the issue. It’s days like this that I go from thinking I understand the rendering to really flailing.