53

Zine: A Static Site Generator Written in Zig

Fun thing, I finished something quite similar in a week: https://git.sr.ht/~q3cpma/make-website ; down to the page language using the macro DSL of https://github.com/ruricolist/spinneret via runtime compilation of the (compile nil (lambda () ...)) kind. It's just HTML, other than that.

Obviously very tailor-made for my website (https://world-playground-deceit.net/) but I plan on improving that part once I'm fully satisfied with it.

3 hours agoa-french-anon

Could it be preview and hosted on https://static.app/ ?

an hour agoandrew-jack

The result is purely static and the only redirection I make is from / to the welcome page; so using index.html as output would probably be enough to "just werk" with stuff like this or Github Pages/neocities.

Not sure about what you mean by preview, but here's how I do it: build the website, copy the output directory somewhere, run `sed -E -i 's#(href|src)=("?)/#\1=\2file:///absolute/path/to/dst/#g' dst/*/*.html` and open a page as file in my web browser.

19 minutes agoa-french-anon

Interesting project..

> The most prominent feature of Zine is that every file format it uses has been created from scratch in order to handcraft the content authoring experience.

Sadly, this part is more of a detractor for me. Using generic templating languages, markup languages, etc. means that I'm not locking my content in to the only SSG that supports SuperHTML, SuperMD, Ziggy etc.

I appreciate the enthusiasm and open sourcing this for others to learn from, good luck with the project!

a day ago22c

I fully agree, new file formats are a nuisance, especially to make. I wouldn't have done it if the existing solutions felt good enough.

Want to add logic to a HTML template? Say goodbye to syntax highlighting, autoformatting and any form of error checking.

Want to embed a video in markdown? Gotta put HTML in your content, the exact kind of thing you were trying to avoid by using Markdown in the first place.

That's a very shitty in-between situation that I personally wanted to get away from. I'm sure for people who don't stress too much about these points (maybe even just because they do less of this kind of work than I do), it's more valuable to leverage formats that they already know, but for me it's a death by a thousand cuts.

a day agokristoff_it
[deleted]
a day ago

Reusing the markdown link syntax is interesting. I wonder if it can be extended to allow for extra attributes, for example srcset. The parenthesis make it look like a function so maybe adding more arguments, something like:

    []($image.buildAsset('icon32.png'), {$image.buildAsset('icon64.png'), '2x'})
19 hours agosionisrecur

The most interesting part of this project to me is that the templating is valid html. What bothers me about Hugo is that there is no language server that works well with it, at least that I know of. This might be interesting to experiment with.

a day agotristan957

This looks so nice. My site is currently Hugo but I can not stand its syntax. Its painful. I am not a Rust or Go or whatever templating language its using guy. I have been thinking of updating my site, but I feel stuck.

Zine looks super simple to understand and follow on the other hand.