A few thoughts on Astro
A few thoughts on Astro
I’ve only just set this thing up, so this is more filler to have something on the page rather than anything of value.
This blog was an experiment with getting something set up in Astro. It’s pretty fantastic.
Static sites are the way to go
The sheer simplicity of hosting a bunch of static files on any number of plug-and-play hosts is fantastic. I don’t have to worry about databases, state or crazy traffic spikes. (Or at least I’m trusting cloudflare pages to do some CDN)
All my content is version controlled with git as markdown files instead of on some db that I need to export to move somewhere else. Rad.
It’s kind of fun seeing the web come full circle on this stuff. I think it mostly comes down to git lowering the barrier for version control. You no longer need a crazy content management system for simple blogs.
As much javascript as you want, without javascript
Astro is an interesting framework in that it almost feels closer to an old school php app. It’s a mix of presentation and “back-end” logic in what’s really just a rendered html template.
It’s just a little weird because the templating language is javascript, or really jsx with a
node-style preamble. You can totally deploy that backend to a server and do additional calls per request
before sending the page to the user if you want. In this specific static page use case, all the templates
get rendered when the site is built with a quick npm run build
command.
Single page applications and the corresponding frameworks do quite a lot of heavy lifting. React and Angular and their ilk are great for juggling interaction and managing UI state. But they can be exhausting for just basic stuff. “Hi browser, here’s an html document.” feels correct for a blog.
It’s also totally possible to mix and match astro with front-end frameworks (or just custom webcomponents), and they have a whole architecture around it. It’s probably the most interesting thing they’ve come up with, and I’m completely ignoring it.
It’s easy to hit the ground running
You can get away with just canabalizing the starter blog template. They have a really nice cli wizard. This guy is hosted on cloudflare pages, but netlify, github pages or just an s3 bucket and some aws magic are probably all fine.
Once it’s all setup, you can just scribble some markdown, do a git commit, and see your very own typos out there for the world to enjoy. There are plenty of resources on the site for getting that “git-ops” process started for pretty much every host.
This blog looks like shit because I wanted to make it my own, and I make shit websites. It looks like the move for hitting the ground running with something nice is to start from one of the theme repos on the site.