- xml - AJAX/Jquery XML 解析
- 具有多重继承的 XML 模式
- .net - 枚举序列化 Json 与 XML
- XML 简单类型、简单内容、复杂类型、复杂内容
我生成我的 blog使用 blogdown,但是当我试图将它提交给 R-Bloggers 时,它不被接受,因为 my feed返回以下错误:
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/ ) 中,他们提供了当前“随附”Hugo 的嵌入式 RSS xml 文件。根据文档,一个部分的 RSS 将呈现在/SECTION/index.xml (例如 http://spf13.com/project/index.xml )。因此,对于您的帖子,它将是 http://spf13.com/post/index.xml .
内置RSS xml文件中的关键行是这一行:
<description>{{ .Summary | html }}</description>
从这个讨论 ( https://discourse.gohugo.io/t/full-text-rss-feed/8368/2 ) 来看,您似乎想要更改来自 .Summary
的描述标签中的内容。至 .Content
.这是作者实现此更改的示例博客文章: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/ ) 并在 header.html
中引用您的 RSS ( https://gohugo.io/templates/rss/ ), 但改变 .Summary
至 .Content
应该可以解决您的问题。
关于r - 我如何在 R-Bloggers 上获取我的 blogdown 博客?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48997278/
我是一名优秀的程序员,十分优秀!