Control index.xml for Atom/RSS (hugo / blogdown generates feed with relative links)

牧云@^-^@ 提交于 2020-01-10 04:00:27

问题


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

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

Example:

 <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>

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

How do I control this?

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


回答1:


  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).

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



来源:https://stackoverflow.com/questions/48414410/control-index-xml-for-atom-rss-hugo-blogdown-generates-feed-with-relative-lin

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!