I think this is a great idea for many reasons, not the least of which is the added flexibility for pulling from content files to create new files in serialized data formats (specifically .json
).
What if you skip the config piece altogether and just allow for overrides in individual front matter for specific use cases where an individual content file should not be output. This assumes the appropriate-file-extension page will be generated automatically based on the extensions alone in the layouts folder(s). Granted, this might be a bigger (breaking) change, and I think this is kind of what you’re saying already:
layouts
|_default
├── single.html
├── single.amp.html
├── single.json (don't konw when you'd use this, but just to extend the example)
├── list.html
├── list.json
├── rss.xml
├── sitemap.xml
##As an aside…
I’ve noticed when editing a local copy of the docs that terms are often confusing in Hugo. I would be careful with the term “content types.” This is pedantic for this feed and slightly tangential, but I think we’re talking about “file type” or—better considering Hugo’s use of “type”—“file format” or “file extension.”
This is a bit more standard, I think…
file format or file extension: .md
, .html
, .json
content type: post, event, author, speaker
content section or section: blog,events,authors,speakers
content model: post <==> author
, event <==>speaker
, etc