I published my drafts: lessons learned and steps taken Light _ □ ✕
  • Posts
  • About
  • Debug
Post

I published my drafts: lessons learned and steps taken

Published
2026-08-07 05:57 UTC (precision: second)
Author
Sal
Source feed
Sal's Blog [exclude this blog]
Link
https://sals.place/blog/fixing-my-published-drafts/
Canonical
https://sals.place/blog/fixing-my-published-drafts
Length
5535 runes
Extracted text
I published my drafts: lessons learned and steps taken Friday, August 7, 2026 As I mentioned, I accidentally published all my draft posts. You know, the ones I cheekily listed at the bottom of my ripgrep post. All public and in my RSS feed. Dangit. What happened I can’t know for sure, but here’s what I suspect happened. Sloppiness on my part When Hugo builds my production site, it puts the files in the public/ subdirectory. I then upload that subdir to Cloudflare Pages with wrangler. When Hugo runs its local dev server, which renders all my draft posts, it puts the files in the public/ subdirectory. See where I’m going with this? I have to assume that, when I ran my production deploy, the public/ folder was dirty with the dev server’s version of the site. Talk about a rookie mistake. I’d been keeping the server running on purpose because I ran a pre-deploy check that scraped the site for broken links. I think I’d been passively assuming that the dev server stuck its build somewhere else, and I was too buried in all the Hugo learnings to think too hard on it. Plus, everything had been working fine for the first couple days, so it slipped off my list of concerns. Rollbacks are nice I was struggling to get my fix deployed (see The plot thickens section below), but fortunately the Cloudflare dashboard came to my rescue. It has a history of my deployments, and with a click I can instantly roll the site back to any of the recent ones. I found the latest one that didn’t have my drafts, and rolled back to it. Adding guardrails I then spent a lot of time adding scripts and automation to prevent this sort of thing from happening again. Pre-build: Wipe and recreate the public/ folder. Build: Added --cleanDestinationDir to the hugo build call (probably redundant with the wipe above, but belt and suspenders). Pre-deploy: Error if (DRAFT) appears in my homepage or RSS feed files (I append that to the draft titles in my Hugo templates); Error if localhost links appear in my homepage or RSS feed files (to guard against this problem); Error if the Hugo server is running locally. Pre-prod: Wired up a proper staging deploy to a Cloudflare Pages preview site, including its own working RSS feed, of which I am now a proud subscriber. Post-deploy: Scrape the deployed site to double check that none of the problems above appear there either. This is all part of my Makefile now, so make deploy_staging and make deploy_prod automatically do the cleaning, building, double checking, and deploying. The plot thickens: Cloudflare Pages not updating At this point I’m thoroughly gunshy about deploying to prod given my recent misadventures, so I used my staging deployment to test all these checks out. And I found a stubborn problem: broken files in staging weren’t getting updated when I’d redeploy. For example, the <link rel="alternate"... element in my topmost index.html file — the element that tells RSS readers where to find my RSS feed — had localhost as its URL domain. And no matter how many times I re-deployed the corrected site, it wouldn’t change. I tried wrangler’s --skip-caching flag. I tried purging the cache in the Cloudflare Dash. I checked my local public/index.html probably over thirty times to confirm it was correct. I tried downgrading wrangler to an older version, since it’s had several updates recently. I had a dozen conversations with Gemini about it. No matter what, each time I’d deploy, my staging site’s homepage content wouldn’t budge. Eventually I tried deploying the site to a net-new Cloudflare Pages preview site. The new site did not have the problem. Okay, good, I’m not crazy. Then I shoved some changes into my homepage and re-deployed to staging. Aha! That fixed the problem in staging. So, I suspect I’ve hit some bug in how Cloudflare manages updates. I assume the deploy logic thinks it already has the latest version of the file despite the fact that the local one has different content. But if I make additional changes to the local file, it seems I can unstick it. To address this, I added one more script to my deployment pipeline. This script adds a comment with a timestamp to the bottom of my public/index.html and public/index.xml files after they are built by hugo. The comments look like this: <!-- build 1786050421 --> They should be invisible to the reader, but in theory, they will nudge the Cloudflare logic to update those two pages on every deploy. This seems like a reasonable time to cite the old classic: There are only two hard things in Computer Science: cache invalidation and naming things. — Phil Karlton (via Martin Fowler) Back to GitHub-triggered deploys? In the midst of all this, I said screw it, this is too wonky and time consuming, I’ll just go back to having Cloudflare build the site from pushes to GitHub. I set all that up, but the build was failing because Cloudflare Workers uses an older hugo binary. I set the HUGO_VERSION env var as guided by the Cloudflare docs, but it still used an old version. Then I remembered I’d also have to get dart-sass installed in the worker for it to be able to compile my CSS. Gah. So I gave up on this and went back to solving the problem above. Maybe things work now My Makefile is now labyrinthian. It might work. Who knows. And to you bloggers who use Bear, Micro.blog, Write.as, Pure Blog, etc. … you may now nod and smile in smug satisfaction with your choices. (Although, this sort of firefighting is kinda fun. Once I the fixing-it part, anyway.)
Stored topics

Every stored assignment is listed, including rows below the current cutoff (0.75), so a missing tag can be explained.

Concept Code Score Meter Margin Origin Path
economy, business and finance economy-business-and-finance 0.99 4.97 ↑derived from 20000225 economy, business and finance
products and services products-and-services 0.99 4.97 ↑derived from 20000225 economy, business and finance > products and services
computing and information technology computing-and-information-technology 0.99 4.97 direct economy, business and finance > products and services > computing and information technology
science and technology science-and-technology 0.98 3.87 ↑derived from 20000763 science and technology
technology and engineering technology-and-engineering 0.98 3.87 ↑derived from 20000763 science and technology > technology and engineering
information technology and computer science information-technology-and-computer 0.98 3.87 direct science and technology > technology and engineering > information technology and computer science
software and applications software-and-applications 0.97 3.38 direct economy, business and finance > products and services > computing and information technology > software and applications
Software development software-development 0.97 3.32 direct economy, business and finance > products and services > computing and information technology > software and applications > Software development
Information security information-security 0.94 2.80 direct science and technology > technology and engineering > information technology and computer science > Information security
arts, culture, entertainment and media arts-culture-entertainment-and-media 0.93 2.52 ↑derived from local:blogging arts, culture, entertainment and media
mass media mass-media 0.93 2.52 ↑derived from local:blogging arts, culture, entertainment and media > mass media
social media social-media 0.93 2.52 ↑derived from local:blogging arts, culture, entertainment and media > mass media > social media
Blogging blogging 0.93 2.52 direct arts, culture, entertainment and media > mass media > social media > Blogging
Open source open-source 0.93 2.52 direct economy, business and finance > products and services > computing and information technology > software and applications > Open source
media and entertainment industry media-and-entertainment-industry 0.69 0.78 ↑derived from 20000306 economy, business and finance > products and services > media and entertainment industry
books and publishing books-and-publishing 0.69 0.78 direct economy, business and finance > products and services > media and entertainment industry > books and publishing
environment environment 0.52 0.06 direct environment
artificial intelligence artificial-intelligence 0.32 -0.73 direct science and technology > technology and engineering > information technology and computer science > artificial intelligence
arts and entertainment arts-and-entertainment 0.30 -0.83 ↑derived from 20000013 arts, culture, entertainment and media > arts and entertainment
literature literature 0.30 -0.83 direct arts, culture, entertainment and media > arts and entertainment > literature
sport sport 0.30 -0.85 ↑derived from 20001183 sport
competition discipline competition-discipline 0.30 -0.85 ↑derived from 20001183 sport > competition discipline
eSports esports 0.30 -0.85 direct sport > competition discipline > eSports
Self-hosting self-hosting 0.27 -1.00 direct economy, business and finance > products and services > computing and information technology > Self-hosting
lifestyle and leisure lifestyle-and-leisure 0.17 -1.60 ↑derived from local:mmorpg lifestyle and leisure
leisure leisure 0.17 -1.60 ↑derived from local:mmorpg lifestyle and leisure > leisure
game game 0.17 -1.60 ↑derived from local:mmorpg lifestyle and leisure > leisure > game
video game video-game 0.17 -1.60 ↑derived from local:mmorpg lifestyle and leisure > leisure > game > video game
MMORPG mmorpg 0.17 -1.60 direct lifestyle and leisure > leisure > game > video game > MMORPG
Tabletop gaming tabletop-gaming 0.14 -1.81 direct lifestyle and leisure > leisure > game > Tabletop gaming
film industry film-industry 0.13 -1.92 direct economy, business and finance > products and services > media and entertainment industry > film industry
scientific research scientific-research 0.12 -1.97 ↑derived from 20000739 science and technology > scientific research
scientific exploration scientific-exploration 0.12 -1.97 ↑derived from 20000739 science and technology > scientific research > scientific exploration
space exploration space-exploration 0.12 -1.97 direct science and technology > scientific research > scientific exploration > space exploration
labour labour 0.12 -1.97 direct labour
society society 0.09 -2.32 ↑derived from 20001300 society
fundamental rights fundamental-rights 0.09 -2.32 ↑derived from 20001300 society > fundamental rights
privacy privacy 0.09 -2.32 direct society > fundamental rights > privacy
Cryptography cryptography 0.09 -2.37 direct science and technology > technology and engineering > information technology and computer science > Cryptography
hobby hobby 0.08 -2.42 direct lifestyle and leisure > leisure > hobby
crime, law and justice crime-law-and-justice 0.08 -2.50 ↑derived from 20000086 crime, law and justice
crime crime 0.08 -2.50 ↑derived from 20000086 crime, law and justice > crime
cyber crime cyber-crime 0.08 -2.50 direct crime, law and justice > crime > cyber crime
education education 0.07 -2.65 direct education
conflict, war and peace conflict-war-and-peace 0.05 -2.92 direct conflict, war and peace
streaming service streaming-service 0.04 -3.07 direct economy, business and finance > products and services > media and entertainment industry > streaming service
politics and government politics-and-government 0.04 -3.15 direct politics and government
social sciences social-sciences 0.04 -3.21 ↑derived from 20000747 science and technology > social sciences
history history 0.04 -3.21 direct science and technology > social sciences > history
health health 0.04 -3.28 ↑derived from 20000464 health
health treatment and procedure health-treatment-and-procedure 0.04 -3.28 direct health > health treatment and procedure
climate change climate-change 0.03 -3.37 direct environment > climate change
television television 0.03 -3.54 direct arts, culture, entertainment and media > mass media > television
animation animation 0.02 -3.69 direct arts, culture, entertainment and media > arts and entertainment > animation
natural science natural-science 0.02 -3.72 direct science and technology > natural science
visual arts visual-arts 0.02 -3.76 ↑derived from 20000036 arts, culture, entertainment and media > arts and entertainment > visual arts
photography photography 0.02 -3.76 direct arts, culture, entertainment and media > arts and entertainment > visual arts > photography
family family 0.02 -3.77 direct society > family
biology biology 0.02 -3.78 direct science and technology > natural science > biology
disease and condition disease-and-condition 0.02 -3.80 ↑derived from 20000458 health > disease and condition
mental health and disorder mental-health-and-disorder 0.02 -3.80 direct health > disease and condition > mental health and disorder
human interest human-interest 0.02 -4.03 ↑derived from 20000498 human interest
award and prize award-and-prize 0.02 -4.03 direct human interest > award and prize
consumer goods consumer-goods 0.02 -4.08 ↑derived from 20001160 economy, business and finance > products and services > consumer goods
handicrafts handicrafts 0.02 -4.08 direct economy, business and finance > products and services > consumer goods > handicrafts
disaster, accident and emergency incident disaster-accident-and-emergency-incident 0.02 -4.16 direct disaster, accident and emergency incident
culture culture 0.02 -4.17 direct arts, culture, entertainment and media > culture
religion religion 0.01 -4.33 direct religion
lifestyle lifestyle 0.01 -4.36 ↑derived from 20001257 lifestyle and leisure > lifestyle
house and home house-and-home 0.01 -4.36 ↑derived from 20001257 lifestyle and leisure > lifestyle > house and home
gardening gardening 0.01 -4.36 direct lifestyle and leisure > lifestyle > house and home > gardening
weather weather 0.01 -4.49 ↑derived from 20001128 weather
weather forecast weather-forecast 0.01 -4.49 direct weather > weather forecast
diet diet 0.01 -4.58 direct health > health treatment and procedure > diet
card game card-game 0.01 -4.60 direct lifestyle and leisure > leisure > game > card game
public health public-health 0.01 -4.93 direct health > public health
podcast podcast 0.01 -5.07 direct economy, business and finance > products and services > media and entertainment industry > podcast
travel and tourism travel-and-tourism 0.00 -5.72 direct lifestyle and leisure > leisure > travel and tourism
exercise and fitness exercise-and-fitness 0.00 -5.84 direct lifestyle and leisure > wellness > exercise and fitness
wellness wellness 0.00 -5.84 ↑derived from 20001239 lifestyle and leisure > wellness
board game board-game 0.00 -5.97 direct lifestyle and leisure > leisure > game > board game
food and drink enthusiasm food-and-drink-enthusiasm 0.00 -6.10 direct lifestyle and leisure > leisure > hobby > food and drink enthusiasm
music music 0.00 -6.14 direct arts, culture, entertainment and media > arts and entertainment > music

← Back to posts

feedtagger 0.1.0-dev model: modernbert-base-zeroshot-v2.0/int8@all-s256 660 posts 0 unclassified min score 0.75