Home Posts

Learning BlogC

So I've been trying out BlogC (the blog compiler). It's been some learning. The documentation is split over two tools and two formats. And although they're all intended to work together, the ways they interact aren't always properly documented. So I'll write down what I learn here.

The Executables

There's two primary tools you'll be using. There's blogc, the compiler, and blogc-make the build system. As the website explains, blogc just converts individual files with no logic to them, while blogc-make turns that converter into a blogging engine. I mainly care about learning to make a blog, so I've spent most my time with these tools with blogc-make.

TODO blogc-make watch

Blog Posts

The blogc markup format is largely a subset of the commonmark standard. There's your headers with series of # at the start of a line, unordered and ordered lists, your editor's markdown-mode will support the format quite well. The only notable part is the ability to define variables at the start of a file (MY_VARIABLE: Value). The name is all-caps, the end of the line is the end of the variable, multi-line variables aren't supported.

The variables section is separated from the markdown with a series of dashes e.g --------------------. These variables are passed as-is to the template, allowing you to use them in there. Speaking of:

The Template Format

It's like writing four html pages, in the same file interlaced with each other. Which is a bit overwhelming at first. But I've grown to like it. As it makes building a unified style that stretches across your entire site extremely easy.

The basic format is a regular static html file, inserting variable values is done with a double-bracket syntax a la {{BASE_URL}}. Global variables can be written in the blogcfile by putting them in the [global] block as all-caps.

To differentiate the aforementioned interlaced files you use blocks e.g {% block <type> %} to open and {% endblock %} to close. The different block types are specified in the manpage for blogc-source, but they're not explained well. So here I'll try to do a better job:

TODO Tags

TODO Special Pages

TODO Images

TODO NixOS setup