我如何在 R-Bloggers 上获取我的 blogdown 博客?

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

我生成 blog using blogdown, but when I have tried to submit it to R-Bloggers it is not accepted because my feed returns 以下错误:

This XML document is invalid, likely due to invalid characters.
XML error: Undeclared entity error at line 6, column 35

显然我网站的 feed 不包含完整的 RSS 内容。如何让它容纳所有内容?

在 Hugo 文档中(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

built-in RSS xml 文件中的关键行是:

<description>{{ .Summary | html }}</description>

来自这个讨论(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/

因此,您可以将 Hugo RSS xml 中的那一行更改为:

<description>{{ .Content | html }}</description>

完整的 rss.xml 文件应该位于您的 layouts/ 文件夹中,其中一行已更改。

看起来确实还有其他选项可以测试,例如在 config.toml 文件 (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/) 中使用输出格式,但将 .Summary 更改为 .Content 应该可以解决您的问题。

这似乎对我有用...

在您的布局文件夹中创建一个名为标签的目录。所以你应该有这个文件夹结构:

<your_base_directory>/layouts/tags

(这不是主题目录中的布局目录)。

然后创建一个新文件:

<your_base_directory>/layouts/tags/rss.xml

然后将 this 粘贴到您新创建的 rss.xml