However the feed is available under: /rss.xml and ideally I would like to have it under /rss so that my subscribers get the new feed automatically without having to inform them
I’ve tried the following without success: suffix="" resolves to /rss.xml with the template under /layouts/index.rss.xml
suffix="rss" resolves as above even with the template as /layouts/index.rss
Is this possible?
EDIT
If not I guess I’ll have to try an XML Level Redirect
EDIT 2
No help needed. I just found out that Tumblr hides the suffix in the URL. The actual Tumblr feed is located under /rss.xml so I don’t think I’ll have a problem with feed readers as I have already named the new feed like the old one.
Like I said yesterday thanks to your input I am able to have the feed without the suffix under /rss but unfortunately I cannot find how to use a custom RSS template with this setup.
No matter what I do Hugo always ends up using the internal template.
I’ve tried the following template variations with no success: /layouts/_default/rss.xml /layouts/_default/index.rss.xml /layouts/_default/index.rss /layouts/_default/rss /layouts/_default/rss.rss
And also I’ve tried all of the above under just /layouts/
The thing is that I really need a custom RSS template. And I am able to render it as needed under /rss.xml
The RSS is a little special in the layouts department (I kept it this way to avoid breaking stuff), so when you redefine that output format you may end up with some surprises.
I simply named the template list.customrss under /layouts/_default/ and BINGO! The custom RSS feed was rendered.
In my config.toml I used exactly what you posted above.
This info is already in the docs in the table for the different Output Formats example: Custom output formats | Hugo
But it wasn’t that clear. I think I’ll send a pull request for the Docs as soon as I have more time to make this plain and simple. To include a phrase like this one:
The naming of an Output Formats template follows the same pattern that is used for standard Hugo templates. eg. list.[kind].[suffix] under /layouts/_default or index.[kind].[suffix] under /layouts/
And then the template is simply called list.xml under /layouts/_default
Mission accomplished. And the custom RSS feed validates at w3c.
One minor issue that I have is that Hugo’s default RSS is rendered as HTML in Firefox with the following encoding declaration appended to it. <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
This doesn’t happen with my Custom RSS Output Format. When I view it in the browser (namely Firefox) it is wrapped in <pre> tags and displayed as code not HTML. But in Feed Readers the Custom RSS is displayed properly. I’ll live with this. Who reads RSS feeds from the browser in 2017 anyway?
So that’s all there is to it for anyone who needs a custom RSS URI when migrating a site to Hugo.