问题
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:
- You need a full
baseURL
inconfig.toml
(see Section 2.2 of the blogdown book); - 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 thepublic/
folder, make sure that you runblogdown::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