New here and successfully launched few blogs on hugo already.
I am having a weird problem with RSS templates: single.rss.xml on my templates folder does not seem to be read at all (hugo uses the default RSS template), I know it’s stranger to want to have a RSS from a simple posting but single.ANYTHING.ANYTHING seems to work ok (single.amp.html for instance), it’s just that the RSS for some reason does not want to work and it reverts back into the default RSS. I have tried placing it in layouts/_default/ and mostly everywhere with zero luck and I am honestly puzzled about this behavior.
So my questions are:
Is this intended? Is there any way I can specify an XML template for an RSS feed from a single post? I can’t seem to be able to find any information on this online.
Is there a way to debug this ? Any way to make hugo verbose so it will let me know what’s the problem exactly ?
I don’t think I can tweak this with Front Matter / Layout (since post/index.html should also work with regular HTML templates) , I may be wrong. As I mention, I am still new at hugo.
single.rss.xml is used for single items. post/index.xml is a list page and uses the list template. you explicitly tell Hugo to only parse single items with your template, for the rest it falls back on the internal templates. Rename it from single.rss.xml to rss.xml and see what happens? Or make a copy list.rss.xml to apply only for list pages.
Where exactly is the md-file you want to transform? You wrote before http://localhost:1313/category/post/index.xml does not use your template - is the file in /content/category/post/index.md? You might want to put your template then in /layouts/categories/rss.xml.
But if just using _default/rss.xml should have done the trick and be used for all items… strange.
I’ve tried (placing single.rss.xml and rss.xml literally everywhere in the lookup order) and this is really weird, it doesn’t work.
I am going to try to spend a good chunk of time tomorrow on this, I think it may be a bug and I may be able to dig in the code, but in the meantime, could anybody try to replicate this ?
Fixed. Do not ask me why, but I removed all old RSS templates, put only one on _default/ and it works wonders now. Seriously, I have no idea what was going on, but this is how I made it work :