I made a Static Site Generator
none of the other ones were silly enough
I've used Static Site Generators for previous websites in the past (specifically Jekyll and Zola) and while they're great for content that is structured and consistent, I found the ones I used a bit clunky for sites like this one where there's a lot of stuff that is unique to each page. I wanted an SSG that was versitile and extensible enough to work with all the weird stuff I throw at it without having to program anything new.
The system I've come up with replaces the templating-language capabilities of other SSGs with the ability to define the content of websites using executable files. There are two ways these can be used:
- Commands, which return an output given arguments. These look like {! date !}
- Filters, which wrap around content and write it to a programs STDIN. These look like {% cowsay -f kitty %}meow{% end %}
With these, and the help of some built-in executables (work-in-progress) you can replicate the capabilities of a templating language and more!
Progress
- Functions
- Built-in/installation-wide functions: i.e {! include navigation !}
- Filters
- Templates
- Template inheritance
- Set which template to use
- Context and Variables
- Formatting for arays and subtables.
- Custom formatting for floats, dates, etc
- Pass variables to commands
- Project structure and configuration
- Configuration file
This can also be used to establish what the 'root' directory of a project is when running from a subdirectory.
- Configuration file
- Render from STDIN
Current Issues
- No way to escape strings in commands arguments yet
- The program can't process encodings other than UTF-8 (This shouldn't be a problem except in rare cases)
Source code
I'm currently keeping the project to myself until it's in a state where I'm happy to release it. Once that happens, it will be available on Codeberg.
Back to home Published 2024-12-05 - Updated 2025-02-08