问题
Task: I want to add an RSS feed to my site. (Later I want to add a separate RSS feed for a specific category [for R Bloggers])
Setup:
- I use the Hugo Academic template
- via the R blogdown package
- push my sources to github https://github.com/Tazinho/AlmostRandom
- from where it gets published via netlify http://www.malte-grosser.com/
- added an example blogpost here http://www.malte-grosser.com/post/test-post/
Issue and validation:
According to this video https://www.youtube.com/watch?v=gF0tohv99Ow my blogs rss should be this http://www.malte-grosser.com/index.xml
According to some validator side http://www.feedvalidator.org/ My rss feed seems not to be valid and has several kinds of errors http://www.feedvalidator.org/check.cgi?url=http%3A%2F%2Fwww.malte-grosser.com%2Findex.xml eg: line 5, column 11: link must be a full and valid URL: / [help]
Steps to solve this so far:
- I followed some SO posts, as far as I could. For example this related one
- Control index.xml for Atom/RSS (hugo / blogdown generates feed with relative links)
I added rss.xml to /post/layouts/ and modified it according to
- https://coolbutuseless.bitbucket.io/2018/02/07/blogdown-rss-feed-of-full-articles/
- I struggled a bit with the part under "# Reference your RSS Feed". I don't know wehre exactly what exactly has to go
- I read several other posts and tried to find similar public repositories from rbind.io.
- I deleted most of my trials, to have a clean setup for further trials
the only parts I kept are the following changes within config.toml
- baseurl = "http://malte-grosser.com/"
- rssLimit = 10
[outputs] home = [ "HTML", "CSS", "RSS" ] section = [ "HTML", "RSS" ] taxonomy = [ "HTML", "RSS" ] taxonomyTerm = [ "HTML", "RSS" ]
and the rss.xml under /post/layouts/
回答1:
From my understanding (after reading once more Control index.xml for Atom/RSS (hugo / blogdown generates feed with relative links)) it seems to be ok to have these kind of errors.
Also for anyone with similar problems: It turns out that the blogs RSS should be under http://www.malte-grosser.com/post/index.xml and the categories RSS's should be under http://www.malte-grosser.com/categories/R-bloggers/index.xml
来源:https://stackoverflow.com/questions/49222650/control-index-xml-for-atom-rss-to-generate-valid-rss-feed-without-relative-link