Some Bits: Nelson's log

Astro static site generator

I took a quick look at Astro, a newish open source framework for building (mostly) static websites. It looks pretty nice but may not be what I want for my current project, (once again) trying to replace my ancient dynamic blog engine with a modern static site.

The big thing Astro seems to enable is Javascript-heavy static sites. If you want to use React, Vue, Svelte, etc to build a complex Javascript site, but you want everything statically pre-rendered, Astro looks to be your choice. There’s a lot of fancy support for dealing with Javascript, CSS, fonts, etc and getting them to assemble to a nice static page for the client. Also integration with GitHub (for code hosting) and Netlify (for site hosting). I think that’s an interesting spot to be in for a framework in 2023. (Also kind of the opposite of another paradigm I think is interesting, very lightweight Javascript and using HTMX to bridge to a dynamic server.)

One minor annoyance: even the very first empty template project loads about 5kb of client side Javascript. It doesn’t seem to be doing anything and I think can be removed. But it says something to me that even the null project already has client side Javascript; this is a tool intended for Javascript sites.

What Astro doesn’t have out of the box is a blog engine. They have a great tutorial that has you create a blog, very nicely written and easy to follow. But along the way you’re writing code like “enumerate all the markdown files for the posts then use that to build an index of my blog posts”. Ie, you’re coding your own blog layout. That’s fine as an example of building your own static site. But I’m just trying to set up a blog, I’d rather have that stuff built in already.

Maybe that stuff does exist. Astro has a bunch of blog themes, perhaps Astro + an off the shelf theme is what I’m looking for. So I gave Blogster minimal a try. It’s kinda nice and has zero Javascript in the built output, a goal I want. But this looks more like another demo of how to build a blog. In particular there’s no easy way to extend this code short of forking the github project and building your own. Which is fine, but more like programming Javascript and less like customizing some static HTML templates. That’s great if you want to really customize but is work I’m hoping to avoid.

I’m left with the impression Astro is a good choice if you are expecting to write a lot of code to build something unique and custom.