Since a couple of weeks, I use the PieCrust static website generator to bake this blog locally on my computer before syncing it with my website. Although there is a learning curve, working with PieCrust proved to be generally easy, with the one exception of setting up a RSS feed for my blog.
Yes, there is a kind of tutorial on PieCrust’s website, but at least for me it wasn’t self-explanatory how to set up the feed on a baked website. After spending the better part of today on this issue, I’ve now figured out how to achieve this in a way the feed
- is updated when your website’s content changes (this was the most difficult part);
- is in the proper xml format;
- is located in the right location on the baked website.
Just add a specific feed page file to the /_content/pages folder of your local website setup and PieCrust will update it everytime it re-bakes the website. PieCrust seems to be a bit special with regard to when it will update specific pages of the website, unless you force it to re-bake everything, but it seems I got it working now.
I have uploaded my version of this feed page file as a GitHub Gist. Place the feed.xml file in your /_content/pages folder. PieCrust will then generate a feed.xml file in your website’s root folder during baking.
In your website’s index page, you can (and should) have a link to your feed. You could either have a visible link in the body of the page that looks like this:
Another common approach is to have an (invisible) link to your feed in the head part of your index page. This allows feed reader software to detect your feed. If you use the website template delivered with PieCrust, you should edit the default.html file, which is located in the /_content/templates folder of your website, and add this line to the head part of the template:
<link rel=”alternate” type=”application/rss+xml” href=”http://yourdomain.com/feed.xml” />