Absolute URLs in Feeds in Pelican

I am still tinkering with Pelican 2 weeks after migrating this blog from WordPress. There are a few things just aren't right but fortunately it is written in Python, has a basic plugin architecture and is easy to mock around to produce the result I am looking for. One issue I had was absolute URLs in the feeds. I much prefer to write with relative URLs if possible, and previously wrote URL Absolutifier WordPress Plugin to fix up links in the RSS / Atom feeds. Googling around I couldn't find anything similar for Pelican so I decided to roll my own.

Here it is. A bit hack'ish with monkey patching the feedgenerator library, but hey, it works :)

Installation steps:

  1. Download the plugin file urlabsolutifier.py

  2. Save it to your plugins directory.

  3. Add 'urlabsolutifier' to PLUGINS in your pelicanconf.py

That's it! If you are not sure how to install plugins for Pelican here is the doco. All your relative anchor tags and image tags will now have absolute URL in the feeds.