Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I get my blogdown blog on R-Bloggers?

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?

like image 368
nathaneastwood Avatar asked Feb 26 '18 21:02

nathaneastwood


People also ask

Can you make websites with R?

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.


1 Answers

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.

like image 197
Alison Hill Avatar answered Oct 26 '22 23:10

Alison Hill