Pelican (Python static site generator)

I mostly use Jekyll for websites, but I consider giving Pelican a try since I started to work in Python.

Have you tried Pelican already? What did you like about it and what was less great?

1 Like

I did! It’s pretty flexible, well-documented and easy to configure. It’s also reasonably easy to make your own theme, though that’s relative. However it’s designed for blogs, and won’t like it if you try to force it into a static site.

1 Like

Oh, that is a good point! Maybe I better start out with a blog instead of a static non-blog-site for a trial run then.

I have used it for a side project… that I also just migrated to Zola. Part of the motivation was just because I was curious about Zola and wanted to try a new static side generator; Pelican didn’t suck. However, it has two quirks that made me choose that site in particular to port to a different SSG:

  • Frontmatter is in a super weird, nonportable Key: value format. Once you have seen the light of yaml/toml frontmatter as in Jekyll, Hugo, and Zola, this starts to look really brittle and janky, especially if you want to come up with some sort of custom tagging/metadata system. (Looks like there is a plugin for yaml frontmatter after all: Pelican, Markdown, and Front Matter)
  • There are sort of parallel universes of build commands: pelican publish vs. make publish vs. invoke publish, etc. Publish your site - PELICAN 4.12.0 This irked me because I was never sure if all were fully equivalent/responded to the same configuration.
1 Like

If you want to feel like you are programming your site in Python, I would recommend trying to roll your own SSG using Jinja2 (templating language) and a Python markdown parser of your choice (I like mistune). You could use tomllib or something for configuration. This gives you a lot more control, plus you get to learn reusable skills (Jinja2 is also used by Django web framework I think).

Maybe get crazy and try binding to a rust markdown parser or template language if you want rust speed.

1 Like