6

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?

Taraas
  • 1,268
  • 1
  • 11
  • 20
  • 1
    "Also" is bad on StackOverflow. I know it is tempting to ask several questions in one post, but please always open new posts for different questions, otherwise we can never finish the answer. Thanks! – Yihui Xie Jan 26 '18 at 07:14
  • You have a point. I felt like it's a supporting question rather than a new one. I.e. both are basically about controlling the index.xml generation. That was my thought process. But I'll trust your judgment. – Taraas Jan 26 '18 at 17:13
  • Thanks! Modular posts will be easier for both people who answer your questions and future visitors. If someone has a question about the relative URL, read this post. If someone has a question about the content of the RSS feed, read another post. If someone happens to have both questions, read two posts. In theory, all questions about Hugo can be "supporting questions", but you certainly wouldn't ask everything about Hugo in one post. Just like modularized code makes programming more efficient, it will make the Q&A world better if questions are modularized. – Yihui Xie Jan 26 '18 at 17:28

1 Answers1

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

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

Yihui Xie
  • 28,913
  • 23
  • 193
  • 419
  • 1
    **You need a full baseURL in config.toml**: Yep, indeed it was: baseurl = "https://taraskaduk.com". **I recommend you to publish your website via Github and Netlify**: And that's exactly the way it is done. via Github and Netlify. I'm trying to do everything by the book! – Taraas Jan 26 '18 at 17:11
  • My `config.toml`: https://github.com/taraskaduk/taraskaduk/blob/master/config.toml – Taraas Jan 26 '18 at 17:14
  • You may need a trailing slash: `https://taraskaduk.com/` I mentioned the trailing slash in this section: https://bookdown.org/yihui/blogdown/themes.html Whether one needs a trailing slash is up to the theme author, but I'd always add the slash (it won't hurt if it is not necessary). – Yihui Xie Jan 26 '18 at 17:21
  • BTW, in your repo, you committed [the `public` folder](https://github.com/taraskaduk/taraskaduk/tree/master/public). If you are using Netlify to publish your website, there is no need to commit this folder in GIT (but it won't hurt if you do). https://bookdown.org/yihui/blogdown/version-control.html – Yihui Xie Jan 26 '18 at 17:31