I don’t know whether that’s a Hugo bug, or whether that’s intended behavior and the theme just had a buggy template to begin with. I can’t find anyhing related in the release notes.
I’ve reported this to the theme that I’m using, but the maintainer didn’t give any comments. So, now I’m here to hopefully find out what’s going on. See that report for futher details and the reproducer.
On a side note, it’s strange that Hugo doesn’t even check whether its RSS output is valid XML! I’d prefer to see an error from Hugo instead of randomly discovering the issue later. We should probably create a feature request for this, unless that’s already possible and my theme+config somehow disables the validation
The theme/template author is responsible for creating a template that renders valid XML. Hugo’s embedded RSS template handles this as expected/desired:
Sure. But it would be nice to have a post-template-expansion check to help template authors (and the users of their templates) to notice and fix the issues earlier. Hugo knows that the output format of the generated file is “RSS”, so it shouldn’t be hard to run this check on the necessary files.
I’ve just tried it. It does, indeed! So, the theme had a buggy custom template. Ok, thank you. I’ll close this thread and create a separate one to discuss my feature request
This is unrealistic. Do you expect Hugo to validate HTML, CSS, JavaScript, and sitemaps as well? Validation is somebody else’s problem. Garbage in, garbage out.