Session

How I Continuously Deliver Content to my Blog with Markdown, GitHub, Python, and Netlify

After being sick of long and broken builds from my javascript-based static site generator I decided it was time to switch to a language I was far more comfortable in. At the time I was really interested in learning how to build my own frameworks with pluggy, so a new static site generator was born.

Markata was born

The idea of markata is a plugins all the way down static site generator at the intersection of markdown and data. It comes with 6 defines lifecycle methods, 21 pre-defined plugins, a cache store built on diskcahe, and a configuration system. Creating new functionality is as easy as making as decorating lifecycle functions with a markata lifecycle method and adding it to the list of active plugins in your markata.toml.

  • 6 lifecycle methods
  • 21 pre-defined plugins
  • cache store
  • toml based configuration
Markdown

All of the content on this site is written in markdown and always has been. Moving to the new site I chose to use pymdown-extensions so that I could potentially use some of their great existing extensions.

Pluggy

Comes from pytest and allows users to easily modify the framework to their liking.

Diskcache

Markata defines a diskcache cache for you. Markata provides a convenience function to help make your own unique cache key consistently. Plugins can access the cache, add to it, and set their own expiration interval.

Configuration

Everything is in toml.

GitHub Actions

Rendering the site inside of github actions with the cache is pretty straightforward with these four steps. Keying off of the configuration will bust the cache every time we change the configuration. You can hack a full rebuild by changing anything inside of the configuration file.

I deploy to netlify but any static site host would work.