控制 Atom/RSS 的 index.xml(hugo/blogdown 生成带有相关链接的提要) [英] Control index.xml for Atom/RSS (hugo / blogdown generates feed with relative links)

查看:70
本文介绍了控制 Atom/RSS 的 index.xml(hugo/blogdown 生成带有相关链接的提要)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

config.toml中的哪些参数或者/layouts中的哪些文件控制着index.xml的生​​成?

Which parameters in config.toml or which files in /layouts control the generation of index.xml?

当我验证我的 Atom 提要时,我收到了许多错误,几乎所有这些错误都是由于链接不是完整的链接.

When I validate my Atom feed, I get a number of errors, pretty much all of them due to links not being complete links.

https://validator.w3.org/feed/check.cgi?url=https%3A%2F%2Ftaraskaduk.com%2Findex.xml

示例:

 <title>My first shiny app: calculating your hourly rate as a consultant</title>
 <link>/post/2018-01-shiny-rate/shiny_rate/</link>
 <pubDate>Sat, 13 Jan 2018 00:00:00 +0000</pubDate>

我的理解是需要完整链接,即https://taraskaduk.com/post/2018-01-shiny-rate/shiny_rate/

My understanding that a full link is requested, i.e. https://taraskaduk.com/post/2018-01-shiny-rate/shiny_rate/

我该如何控制?

另外,有没有办法将整个帖子传递给 Atom,而不仅仅是描述?

Also, is there a way to pass the entire post into Atom, not just description?

推荐答案

  1. 您需要 config.toml 中的完整 baseURL(请参阅 blogdown 书的第 2.2 节);
  2. 我建议您通过 Github 和 Netlify 发布您的网站(第 3.1 节).不要使用 public/ 目录在您的计算机上本地构建.而是在服务器端构建它.如果您必须在本地构建站点,则每次发布 public/ 文件夹之前,请确保运行 blogdown::hugo_build() (第 1.7 节).
  1. You need a full baseURL in config.toml (see Section 2.2 of the blogdown book);
  2. I recommend you to publish your website via Github and Netlify (Section 3.1). Don't use the public/ directory build locally on your computer. Build it on the server side instead. If you must build your site locally, every time before you publish the public/ folder, make sure that you run blogdown::hugo_build() (Section 1.7).

有关您的 RSS 提要包含相对 URL 的原因,请参阅附录 D.3(简答:baseurl = "/").

For the reason why your RSS feed contains relative URLs, see Appendix D.3 (short answer: baseurl = "/").

这篇关于控制 Atom/RSS 的 index.xml(hugo/blogdown 生成带有相关链接的提要)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆