💾 Archived View for benjaminja.com › log › 2023 › 09 › 03-simple_site_gen captured on 2024-05-26 at 14:35:12. Gemini links have been rewritten to link to archived content

View Raw

More Information

➡️ Next capture (2024-06-16)

-=-=-=-=-=-=-

Simple Site Generator

2023-09-03

#Projects

#Capsule

#Gemini

It’s been a while since I last posted. I have been busy working on my weatherstation. I’ll need to write about that soon, but for now I want to talk about the state of my capsule.

During my breaks from the weatherstation, I have been working on my own site generator. I have finally got it to the point where I can start using it in production. There’s definitely a lot of work left to be done before I can publish it for others to use.

I have been calling it `simple-site` for now, though I’ll probably think of a better name when I actually release it. I have designed the generator to be as simple possible while allowing for complexity to come if desired.

The design starts out with templating. I designed my own simple templating engine that I found works surprisingly well. Each document will be rendered and passed to a chain of configured templates. To get added functionality, scripts can be created which will behave like functions in the templating engine. If you need more control, then generator scripts can be used to make alterations to the structure of the site.

Since I have migrated my capsule over to the new system, I have most likely missed a few things.

Example

Here is a pretty simple example of what my generator does. Hopefully it can help visualize what’s going on.

+- content
|  +- index.gmi
|  +- my-image.jpg
+- templates
|  +- base.gmi
+- site.toml
$ simple-site site.toml
Rendering "index.gmi"  with template "base.gmi"Copying "my-image.jpg"

🔼 Log - 2023

📭 Message me

📝Or mention this post