For one project, I need an xml feed to live at /feed.rss instead of /index.xml. Now I tried adding the rss suffix to the application/rss+xml mediaType before using it on my custom output format.
Now how can I have the file generated at /feed.rss instead of /feed.xml. I tried using a layout called index.rss_feed.rss but it is not being picked up (the output format file is not created)
The key distinction for Hugo versions 0.20 and newer is that Hugo looks at an output format’s Name and MediaType’s Suffixes when choosing the template used to render a given Page .
I think you will have to create a new template name something like:
I think that the only current way to create outputs for different suffix for a given media type is to create multiple media types. We could (and probably should) add a “suffix selector” to output format config …
I’m trying to do something similar with text/html, producing some files with the extension html and others with htm (backwards compatibility).
For example, I’d like to create files as such:
/index.html
/index.htm (would become a redirect to /index.html)
/states/washington_state.htm
/states/wa/index.html