Hello!
Before Hugo 0.146.0 (and its accompanying new template system) was released, I was able to generate section-specific Atom and JSON feeds in my site root, using section list layouts and the following configuration:
Relevant part of config.toml
:
[mediaTypes."application/atom+xml"]
suffixes = ["xml"]
[outputFormats.atomfeed]
mediaType = "application/atom+xml"
baseName = "feed"
isPlainText = true
[outputFormats.jsonfeed]
mediaType = "application/json"
baseName = "feed"
isPlainText = true
[outputs]
home = ["html"]
section = ["html", "atomfeed", "jsonfeed"]
I also had corresponding section-specific list layouts defined as layouts/section/list.atomfeed.xml
and layouts/section/list.jsonfeed.json
.
With seemingly no other relevant configuration, this would cause Hugo to generate section-specific Atom and JSON feed files in the site root (a pair for each section), automatically named /some_section.json
, /some_section.xml
, /another_section.json
, /another_section.xml
, etc. This is my desired behavior.
Post-0.146.0, I can’t figure out how to change my configuration/layouts to replicate this behavior. I was able to get as far as generating /some_section/feed.xml
and /some_section/feed.json
, but not /some_section.xml
and /some_section.json
in the site root as they appeared previously.
Per my interpretation of the documentation, I moved layouts/section/list.atomfeed.xml
and layouts/section/list.jsonfeed.json
to layouts/list.section.atomfeed.xml
and layouts/list.section.jsonfeed.json
respectively. The relevant parts of my config.toml
are unchanged from the above.
I tried setting root = true
and path = "/"
for the relevant outputFormats
in config.toml, but neither of these seemed to have any effect.
How can I configure/instruct Hugo to render section-specific lists in the site root, as it was doing for me before 0.146.0?
(EDIT: I now see that the same behavior also applies to section-specific HTML list pages; Hugo used to generate /some_section.html
but now instead generates /some_section/index.html
. Again, the former is my desired behavior.)