Once I finish my move of Node
to Page
, and everything is a Page which can contain Pages
β which in itself solves some interesting problems β Hugo has a much cleaner model which can be exploited.
I see a lot of questions about rendering alternative representations of a Hugo site, or parts of a Hugo site: how can I create more RSS feeds? How to output a page or site as JSON? Create iCal calendar file? Google AMP? Facebook instant pages? How can I generate multiple representations of the same content?
For discussion, given the content tree below:
content
βββ _index.md
βββ categories
β βββ _index.md
β βββ photo
β βββ _index.md
βββ post
β βββ _index.md
β βββ hugo-rocks.md
βββ tags
βββ _index.md
βββ hugo
βββ _index.md
Today we have some implicit default content types. RSS, html, sitemap.
If we extend on that we could define the output content types in Site config and override in page front matter, i.e.
output = ["rss", "html", "ical", "amp"]
And then we define some template lookup rules based on what gets rendered (taxonomy, home page, section listing etc.), so rendering a section
for amp
would look for templates like this:
return []string{"section/" + section + ".amp.html", "_default/amp.html", "amp.html", "_internal/_default/amp.html"}
Plenty of details left out in the above, but it could be plenty powerful and flexible me thinks. This also allows for creating sites without RSS, sitemap, RSS only and any combo.
Thoughts?