3 ms·
I rolled my own static site generator for very little effort. As it stands, the generator (which isn't public so you'll have to take my word on it) is ~100sloc
by qubyte 9y ago
I rolled my own static site generator for very little effort. As it stands, the generator (which isn't public so you'll have to take my word on it) is ~100sloc plus templates, CSS, etc. The process has been interesting and educational, and I recommend it on those grounds. Adding and modifying features is very easy since it's so little code to work with. Currently:
- posts are rendered from markdown with syntax highlighting for code
- safe links to other domains (noopener and _blank)
- bundled CSS, which look good (or as bad) on mobile
- a PWA (the service worker is the only JS run client-side)
- pre-populated links out to twitter (with a card) and mastodon with tags drawn from markdown metadata
- HTTPS using a letsencrypt cert and a one-liner in cron.daily to update it when close to expiry
- a smallish nginx config focussed on security to serve files
Much of the generator is just glue code around some good modules. Some important things like safe links were hacked together by me.
(if you're interested, https://qubyte.codes https://qubyte.codes, but I need to post more often)