blag is now available in Debian
Last year, I wrote my own blog-aware static site generator in Python. I called it “blag” – named after the blag of the webcomic xkcd. Now I finally got around packaging- and uploading blag to Debian. It passed the NEW queue and is now part of the distribution. That means if you’re using Debian, you can install it via:
sudo aptitude install blag
Ubuntu will probably follow soon. For every other system, blag is also available on PyPI:
pip install blag
To get started, you can
mkdir blog && cd blog
blag quickstart # fill out some info
nvim content/hello-world.md # write some content
blag build # build the website
Blag is aware of articles and pages: the difference is that articles
are part of the blog and will be added to the atom feed, the archive and
aggregated in the tag pages. Pages are just rendered out to HTML. Articles and
pages can be freely mixed in the content
directory, what differentiates an
article from a page is the existence of the dade
metadata element:
title: My first article
description: Short description of the article
date: 2022-06-18 23:00
tags: blogging, markdown
## Hello World!
Lorem ipsum.
[...]
blag also comes with a dev-server that rebuilds the website automatically on every change detected, you can start it using:
blag serve
The default theme looks quite ugly, and you probably want to create your own
styling to make it more beautiful. The process is not very difficult if you’re
familiar with jinja templating. Help on that can be found in the
“Templating” section of the online documentation, the offline
version in the blag-doc
package, or the man page, respectively.
Speaking of the blag-doc
package: packaging it was surprisingly tricky, and
it also took me a lot of trial and error to realize that dh_sphinxdocs
alone
does not automatically put the generated html output into the appropriate
package, you rather have to list them in the package.docs
-file (i.e.
blag-doc.docs
) so dh_installdocs
can install them properly.