Kurt McKee

lessons learned in production

Archive

Announcing pelican-granular-signals

Posted 9 August 2021 in pelican, plugin, python, and website

I'm pleased to announce the release of pelican-granular-signals, the Pelican plugin that guarantees your awesome plugin will get called at the right time, every time.

This plugin exists because of two issues with the Pelican plugin architecture:

  1. Pelican depends on blinker, which does not guarantee the order in which signals are sent.
  2. Pelican doesn't have fine-grained website finalization signals.

This means many plugins have to crowd around the finalized signal like a bunch of kids at the arcade lining up quarters to be the next challenger at the lone Street Fighter Ⅱ machine on a Friday night.

Similes aside, your plugins are forced into a situation where the content may or may not be minified prior to precompression. That's where pelican-granular-signals comes in: it adds several new, granular signals that will be sent after the finalized signal. As of version 1.0.0, the new signals are:

  • sitemap
  • optimize
  • minify
  • compress
  • deploy

Documentation is available in the README. Feel free to suggest additional signals or features!

☕ Like my work? I accept tips!