No I will not live with the missing xml declaration in my custom RSS feed!
Naturally Go Templates showed its ugly teeth once again.
As soon as I included <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
in my list.xml
the first charset “<” became “< ;”, and made the XML unreadable. Exactly as reported over here: https://stackoverflow.com/questions/32333279/golang-template-escape-first-char
I was having none of this weirdness, so Hugo Template Functions to the rescue!
Simply made a partial called declaration.html
its contents are just the xml
declaration from above.
And then in my list.xml
I called it like this:
{{ partial "declaration" . | htmlUnescape | safeHTML }}
Now the Custom RSS renders as HTML in Firefox! Identical to Hugo’s default RSS.
(I feel like I’m on my way to becoming a Hugo guru)