emDash image.

Hello World, Eventually

I didn't want to build a blog this time. I just wanted to click a button and start writing. What followed instead was a Windows path bug, a leftover KV namespace, an invisible logo, and a content type that insisted it already existed.

I have been planning to set up a personal blog for a while, mainly because I wanted a place where I could express myself without feeling the need to polish every thought before putting it out there. Somewhere I could write about things I am thinking about, building, learning or getting annoyed by, without first asking whether it belongs on LinkedIn or whether it has been turned into a sufficiently coherent point of view.

As you may expect, my first instinct was to build it myself, and I actually did. But then the predictable thing happened. What was supposed to be a place to write slowly became another thing to maintain. Hosting, layouts, small fixes, dependencies, features I suddenly decided I needed, and before long I was spending more time thinking about the blog than actually writing on it.

So this time I decided I did not want to build anything. I did not particularly want to go down the WordPress route either, but I still wanted most of what a typical CMS gives you without having to manage too much of it myself.

While looking through various options I stumbled upon a post from the Cloudflare team about how they had moved the Cloudflare blog to EmDash:

https://blog.cloudflare.com/cloudflare-blog-uses-emdash/

That led me to their more detailed post on EmDash and moving away from WordPress:

https://blog.cloudflare.com/emdash-wordpress/

It looked quite interesting, and somewhere on the page was a neat little "Deploy to Cloudflare" button. My immediate reaction was, great, life made easy. Click a button, connect a few things and get on with actually writing.

So I clicked it.

The deployment appeared to complete, I opened the URL and all I got was "Hello world".

Not quite the blog I had imagined.

There was also not much useful information explaining why. The deployment itself looked as though it had succeeded, but clearly something underneath had not. At that point it was easier to clone the repository locally and see what was actually going on than keep guessing from the Cloudflare side.

The first issue was that the project would not build locally on Windows either. Eventually I traced that back to a path being constructed inside one of the dependencies in a format that did not work properly on Windows because it was missing the drive component. The actual fix, once found, was tiny. I changed the way the path was constructed so it behaved consistently across environments and the build started working.

That got me past one problem, but the next deployment failed for a completely different reason. The original failed deployment had already managed to create the Cloudflare KV namespace that EmDash uses for authentication, so every subsequent attempt was trying to create another namespace with the same name and failing because one already existed. I checked the existing namespace, confirmed there was nothing in it that mattered, removed it and allowed the deployment to create a fresh one.

There was then one more Cloudflare-specific issue. EmDash supports running plugins inside an isolated sandbox using Worker Loaders, which is a sensible feature, but it requires a paid Cloudflare plan. I was using the free plan and did not need any plugins that depended on the sandbox, so I simply disabled that part of the configuration.

After that the deployment finally completed properly and, instead of "Hello world", I got the admin setup screen and a functioning EmDash installation.

Of course, having got it working, I could not quite leave it alone.

I made a few changes to the base Astro setup so the site title could sit properly alongside the logo, which then broke the header on mobile until it got a proper hamburger menu. The theme switcher in the footer turned out to be quietly decorative, the toggle changed but nothing on the page ever did, because the build tooling was silently rewriting a modern CSS color function into a version that only listens to your operating system's setting and ignores manual switches entirely. And my logo, a solid black mark, worked beautifully in light mode and vanished completely in dark mode, which a single line inverting its color fixed without needing a second logo file. I also changed the fonts because apparently even when I explicitly decide not to build my own blog, I am still incapable of leaving the typography alone.

I also added a small Quotes section, just a line, an author and an optional date, which taught me that adding a new content type in EmDash only gets you the data structure, not anywhere on the site for it to appear, since unlike posts and pages nobody had written that template yet. Creating it was straightforward once I understood that; getting the admin panel to actually let me create it was not, since it insisted a collection called quotes already existed when nothing in the database agreed. I never worked out why. Renaming it and moving on turned out to be the faster debugging strategy.

All of that, including figuring out why the original deployment was failing, took about an hour. Which is probably the right level of effort for this sort of thing. Much better than spending several days building yet another custom blogging system and then convincing myself that maintaining it is somehow part of writing.

There was nothing particularly difficult about the technical problems either. One Windows path issue, one KV namespace left behind by a failed deployment and one Cloudflare feature that required a paid plan. They were simply three unrelated problems hidden behind what initially looked like one failed deployment.

So if anyone else clicks that Deploy to Cloudflare button and ends up staring at "Hello world", those are probably the first three places I would look.

Anyway, it is up and running now.

Let's see how it holds up, and more importantly, whether having a deliberately less polished place to write actually makes me write more.

And yes, a post about EmDash with no em dash in it. The irony was too good to ignore.