Maybe RSS / Atom is not all the rage these days, but I find them very useful.
Adding an RSS feed to my Jekyll-based website:
Incredibly easy… I thought!
- Add this line to the site’s Gemfile:
gem 'jekyll-feed'
- add this line to the site’s _config.yml:
plugins: - jekyll-feed
- run
gem install jekyll-feed
And, voilá, there is now a «michaelbach.de/feed.xml» (actually, an Atom feed).
Thanks to the authors of this gem!
However…
Yes, there was a feed.xlm file – but all links were directed to localhost!
Finally I found the solution here: https://github.com/nielsenramon/chalk/issues/48 JEKYLL_ENV=production bundle exec jekyll serve
So it looks like the jekyll-feed code looks at the “production” environment variable. Grrr… that should be in the documentation!
After digging a bit more, I find this is a Jekyll thing:
“site.url Contains the url of your site as it is configured in the _config.yml. For example, if you have url: http://mysite.com in your configuration file, then it will be accessible in Liquid as site.url. For the development environment there is an exception, if you are running jekyll serve in a development environment site.url will be set to the value of host, port, and SSL-related options. This defaults to url: http://localhost:4000.”