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-int 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
- Project-wide directory for functions
- Configuration file
This can also be used to establish what the 'root' directory of a project is when running from a subdirectory.
- Render from argument or STDIN
- 'Just build the whole website, please'
- Caching/only rebuilding the changed parts of a site
Current Issues
- Functions and filters must be installed in the user's
PATH
. - No way to escape strings in commands arguments yet
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 2024-12-28