header autolink
update djot@master
better newtab indicator
s4g
(Stupidly Simple Static Site Generator) is an in-place static site
generator, meaning processed files are stored right next to their sources.
This simplifies composing (source dir layout is finished website layout;
static assets no longer need to be moved around) and publishing
(simply rsync
/git push
your whole dir).
It aims to be beginner-friendly while encouraging users to fiddle with
html/css. To that end, the core feature set is intentionally simple:
*.dj
files, generates *.html
in the same place
index.dj
+ custom
template. This means the user is free to swap in their own custom home page.redirects.txt
fileQuality-of-life features:
There's a sample site up at https://nhanb.github.io/s4g/about/. I'm also using s4g to generate my own blog: https://hi.imnhan.com/s4g.
The markup language of choice is Djot because it's the only Markdown derivative that actually tries to be both unambiguous and extensible.
Currently works on Linux. It should also work on macOS and Windows (probably with a tweak to how it calls nodejs), but I'm not testing that.
Requirements: go
(build), node
(runtime).
sudo pacman -Syu go nodejs
go install go.imnhan.com/s4g@latest
# Create new site
s4g new -f ~/my-blog
# Run program, which:
# - listens to changes and automatically re-generates
# - starts a local HTTP server for preview, also livereloads on changes
cd ~/my-blog
s4g
Distant TODO. Maybe I'll write a blog post and call it a day.
writeablefs
is admittedly an unnecessary abstraction. The prospect of
replacing the native filesystem backend with something else is highly unlikely
in the first place. I simply wanted to get used to the ergonomics of
programming portably against an FS interface. I've already violated that in my
recent commits anyway. When I'm sufficiently bored I'll most likely remove it
wholesale.