A static site generator creates static HTML and markdown files to serve a website. I recently researched them to better understand my options for rolling a static site in Python. I am assessing them for this blog, which is hosted on WordPress, as a potential future self-hosted solution.

Why Statics?

Most "modern" websites are dynamic in the sense that the contents of the site live in a database, and are converted into presentation-ready HTML only when a user wants to see the page. That's great. However, it presents some minor issues that static site generators try to solve.

In a static site, the whole site, every page, everything, is created before the first user even sees it and uploaded to the server as a simple folder full of HTML files (and images, CSS, etc).

The Nikola Handbook - https://getnikola.com/handbook.html#why-static

Static Site Generator Python Libraries

listed in largest to smallest order by # of Github project stars

Pelican | Github - 11K Stars

Seems to be the front running static site generator. It contains a convenient pelican-importer tool to import existing content from WordPress, Dotclear, or RSS feeds. Enjoying the modular nature of the Pelican pelican-plugins and pelican-themes!

Cactus | Github - 3,500 stars

"Simple but powerful static website generator using Python and the Django template system. I developed Cactus because [they] wanted a standard, easy system that designers at Sofa could use to build and deploy fast websites. So typical users would be designers that are tech-savvy, want to use templates, but don't like to mess with setting up django or S3."

Lektor | Github 3,500 Stars

Intriguing project with talented maintainers including the author of Flask. It also touts a "Python API" and plug-ins.

Nikola | Github - 2,200 stars

Viable option to host your site with the informative Nikola Handbook serving as your guide and static site knowledge booster.

Makesite | Github - 1,600 Stars

Offers minimal configuration, using only a makesite.py file.

Hyde | Github - 1,600 stars

Began as a Jekyll port (Ruby static site generator). It has since formed its own identity. "Only supported on python 2.7.x. Python 3.x support is in progress."

Mynt | Github - 400 stars

"Designed to give you all the features of a CMS with none of the often rigid implementations of those features."

Staticjinja | Github - 250 Stars

"Minimalist Python library for building static websites with Jinja."

Supporting Links