Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 299
Taraas Avatar asked Jan 24 '18 03:01

Taraas


1 Answers

  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 = "/").

like image 73
Yihui Xie Avatar answered Nov 01 '22 15:11

Yihui Xie