I generate my blog using blogdown, but when I have tried to submit it to R-Bloggers it is not accepted because my feed returns the following error:
This XML document is invalid, likely due to invalid characters.
XML error: Undeclared entity error at line 6, column 35
Apparently the feed for my website does not contain the full RSS content. How do I get it to hold all the content?
The R Project is useful because RStudio will recognize your project as a website, and provide appropriate build tools. Note: After creating the R Project and initial files, you may need to close the project and reopen it before R will recognize it as a website and show the appropriate build tools.
In the Hugo documentation (https://gohugo.io/templates/rss/), they provide the embedded RSS xml file that currently "ships with" Hugo. According to the docs, a section’s RSS will be rendered at /SECTION/index.xml (e.g., http://spf13.com/project/index.xml). So for your posts, it would be http://spf13.com/post/index.xml.
The key line in the built-in RSS xml file is this one:
<description>{{ .Summary | html }}</description>
From this discussion (https://discourse.gohugo.io/t/full-text-rss-feed/8368/2), it looks like you want to change what goes in the description tags from .Summary
to .Content
. Here is an example blog post where the author implemented this change: https://randomgeekery.org/2017/09/15/full-content-hugo-feeds/
So you would change that one line in the Hugo RSS xml to:
<description>{{ .Content | html }}</description>
The full rss.xml file should live in your layouts/
folder, with that one line changed.
It does look like there are other options you could test, like working with output formats in your config.toml
file (https://github.com/gcushen/hugo-academic/issues/346; https://gohugo.io/templates/output-formats/) and referencing your RSS in your header.html
(https://gohugo.io/templates/rss/), but changing .Summary
to .Content
should address your issue.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With