Ask HN: What's the simplest static website generator?
I've tried Jekyll in the past but the setup is a bit overwhelming and it gets complicated super fast. I am looking for something where I can keep my header and footer separate and then include them in every other page. That's it. No CMS and no blog. Is there something which handles this well and is easy to set up?
I use Cloudflare Pages to host my website
75 comments
[ 1.6 ms ] story [ 148 ms ] threadCloudflare page for deploying Next.js static site:
https://developers.cloudflare.com/pages/framework-guides/nex...
On the sidebar they provide a ton of other guides for different generators, too.
I think a hundred or so well-chosen lines of your favourite scripting language can do wonders. Mine is ~300 lines of Bash because I over-engineered a thing or two for kicks. The core of it is maybe 50 lines.
[1] https://github.com/adityaathalye/shite
The README documents the architecture and rationale. Maybe it will help you figure out yours. Happy hacking!
Feel free to clone this repo: https://github.com/cpach/piper
But yes, if I were to recommend something, it'd be Zola given that there's just one executable that you need to run and there's absolutely no setup required.
One major upside of Zola is that it's very stable, so you don't end up updating your dependencies every other day.
One significant downside is that Zola seems to be sometimes a bit creative with the slugs generation, which can generate slug collisions where there shouldn't be any. It's possible to override them manually though.
./bin/pp: cannot execute binary file: Exec format error
Is it because it's a 32 bit binary?
Plumbing is a bit obfuscated, not sure I've written it down anywhere. I write/edit files in obsidian or emacs. The obsidian sync feature copies those to a pi5 which also runs obsidian. That stashes whatever is in the directory into a fossil repo as a backup / sync to other machines mechanism. Something runs make periodically to rebuild the site which gets copied back into obsidian and thus ends up back on whatever device I'm using to edit the files.
A simpler setup would involve committing markdown to a github repo and having a cron/make somewhere pull from that, rebuild the site, commit to the same or a different github repo.
With SSI, your template for every page would basically look like this:
Making your own SSG is another good solution. They're easy to make, and you can tailor them to your own particular needs.Then I built that into a live update system I called TCUP (torstenvl's content update program).
It was a fun project, and ended up being the first non-trivial program I wrote (I was 17-18).
Flask with jinja, then you just do {% extends layout.html %} etc. It might be overkill but it's not that hard
All questions I have, are solved by ChatGPT, e.G. adding "_small" to jpgs.
so I don't need to learn or remember Hugo API.Quite recently I've added jamstack to reduce image sizes etc. to make the site faster.
Just writing simple software feels way better than reading docs for an arcane tool that will change on you over time due to updates.
I think may of us here are guilty of the right hand side.
You might come back to it in a year and hate it, but that’s also part of the SSG vision question every software engineer is required to go through.
I discovered it via one of Kevin Powell's videos: a 20 minutes tutorial to get started using Astro: https://www.youtube.com/watch?v=acgIGT0J99U
I find it very simple to use as a developer, but there are quite a few things happening behind the scenes to make the site itself faster to load for users (e.g. it inlines the CSS so you don't have to load a separate sheet).
The only downside of it is that it depends on a package manager.
Quite simple to start, and a nice system to add some scripting and styles without the requirement of bringing in a framework.
It's there, it works, and it's totally simple. I don't have to do any maintenance or worry about hosting or a domain name.
Images go into my Flickr account, and I save a copy of each post's text, in case I ever want to do something else. But not so far. Been on Blogger since 2009.