Initial Commit
I’ve been spending a lot of my time tinkering away with some toy projects. Then it always gets to the end of the day/month/year and I think what have I been up to and I draw a blank.
This blog is an attempt to:
- Keep myself accountable
- Log a note of things that I’ve done and remind future me of what I did and how I did it
- Practice actually thinking and writing
So here’s blog post number 1, about how I made this blog.
I started with a simple remit of:
- I own the files, I don’t want or need to pay for a monthly subscription and I don’t want to get involved in a platform that could hypothetically end up becoming nazi sympathisers
- No need for any bloated system, I want to write the files in a local text document, push them to a repo and they’re live.
It turns out there are many ways to get this done, but after some research I ended up with:
Astro
Astro seems to be a framework that lets you be as hands-on or as hands-off if you like. It appeals to me in the sense that it just gets out the way, but if I really wanted to I could write a custom component for a specific post if I wanted to. I’ve used jekyll in the past, and still have some old posts living in a repo somewhere but looking back at the setup, it just feels a bit crusty now. I’m very much under the impression that while it has a proven background, its day has been and gone.
Bear Blog
Shout out to https://bearblog.dev/ because if I didn’t have those particular requirements then I absolutely would have used their platform. It looks super simple and clean, and it’s why this blog is using its theme.
Someone already had the same idea I did so getting the structure for this blog was a simple as git clone https://github.com/harleyjwilson/astro-bearblog and editing some configuration for site title and general layout.
Defaults include about/home/blog pages but I just want the root directory to be a list of posts.
It was simple enough to change by replacing the root index.astro file with the posts one and adding the following to astro.config.js:
redirects: { '/blog': '/' },
Deployment
I would normally default to Github Pages to host a static site like this but my DNS is already handled through Cloudflare so I thought if I’ve already got an account why not give something new a try (that and Github is forever having downtime). I am wary about Cloudflare just becoming a central failure point of the internet but that’s a bigger problem way beyond these ramblings.
So using Cloudflare Pages, I connected my github repo and…it just worked. It built and deployed to a test URL without any further configuration. It completely stayed out of my way, exactly what I was looking for.
Because deanhet.com already lives within cloudflare, I went to the domain tab for this new page, added a custom domain of blog.deanhet.com and it was all done. Again, done all the DNS config for me behind the scenes. EZPZ.
Now when I make a change locally, I push the changes to Github and the Cloudflare worker automatically grabs it, builds it, and deploys it.
Future considerations
I need local access to the files if I want to edit them. So I did briefly consider installing my own online content management system. I don’t think this much of a problem right now as this would be more suited to multiple contributors. If I ever was really in a pinch, I could always inline edit files through the Github UI anyway.
It may still happen in the future, and if it does I’m likely going to use Sveltia.