Upgrade to Pelican 4

Posted on Tuesday, 01 January 2019 in IT

This blog now runs on version 4.0.1 of Pelican.

The upgrade from Pelican 3 to 4 was really smooth. Pelican itself was trivial:

pip install -U pelican

The only change I really needed to do was about the way the Jinja2 extensions for internationalisation are activated. This is set in the pelicanconf.py config file:

# Pelican 3:
#JINJA_EXTENSIONS = ['jinja2.ext.i18n']

# Pelican 4:
    'extensions': ['jinja2.ext.i18n']

Without that, Pelican complained that it wasn't able to find an alias for the gettext function.

Apart from that, I used the opportunity to fix some non-blocking warnings:

  • use the {slug} placeholder instead of %s in the format string of the CATEGORY_FEED_ATOM config property
  • replace the former keyword {filename} for links to static resources like images by the new one, which is {static}