The stack I use to run this blog, 2026 edition
By Flavio
Tagged: Blogging
How I run flaviocopes.com in 2026: Astro, Tailwind, Cloudflare Pages, and the small services around a folder of Markdown files.
At its core, flaviocopes.com in 2026 is still a folder of Markdown files compiled by Astro and served as static HTML on Cloudflare Pages. Around that core, I run a few serverless functions, some cloud storage, a scheduled Worker that triggers rebuilds throughout the day, client-side search, self-hosted analytics, my newsletter setup, and transactional email.
I wrote the 2018 version of this post back when the site ran on Hugo and Netlify. Even though I patched it a few times over the years, it still reads like a snapshot from 2018. In this post I’ll walk through everything running the site today, explain why each piece is there, and link to the longer write-ups whenever I have one.
1. Astro
I build the site with Astro in plain static mode, so the build outputs regular HTML files with no server adapter and no server-side rendering. All my blog posts live in an Astro content collection loaded via a glob over the posts folder, backed by a schema that validates the frontmatter.
That schema keeps drafts and future-dated posts out of the production output, and it also lets me keep a URL live while hiding it from the sitemap and post listings. If a post is missing a title or a description, the build fails right away, which saves me from shipping broken metadata across a site this size.
Most of the Markdown pipeline uses the standard Astro setup, plus two custom plugins I wrote myself. The first inspects images and adds their real width and height attributes along with lazy loading so pages don’t jump while they load. The second drops a promo box into longer posts at build time. A handful of pages use MDX because they need components, while RSS and the sitemap come from the official Astro integrations.
Everything I wrote in Why I use Astro back in 2023 still holds up today, and if you want to learn the framework, I also have a free Astro course. The main thing to keep an eye on at this scale is build time, since the site renders thousands of pages. I shared all the changes I made to speed it up in how I made this site build faster.
2. Tailwind
For styling, I use Tailwind CSS along with the typography plugin to format the body of each post.
I went for a newspaper-inspired design with uppercase headings, thin borders, and no rounded corners. All the colors live in CSS custom properties, and dark mode works by toggling a class on the root element to swap them. For typography, I self-host Geist Mono right alongside the site so the browser doesn’t have to reach out to an external font host.
Tailwind has been reliable overall, though one spacing utility did trip me up in the tools section. A reset inside a scoped stylesheet ended up overriding it and collapsing some fieldsets, and it took me a while to figure out why. If you’re learning the current version of the framework, check out my free Tailwind course.
3. Cloudflare Pages
I moved hosting from Netlify to Cloudflare Pages this year. The migration was straightforward because the site was already almost entirely static, my DNS was already on Cloudflare, and the only Netlify-specific parts were a couple of functions and a small blob store. Pages doesn’t bill for bandwidth either.
The Pages project is connected to my GitHub repo and runs a fresh build on every push to master. Each build checks that the downloadable courses are still in sync, compiles the Astro site, and then builds the search index.
I keep all the Pages settings in a Wrangler config file instead of managing them in the dashboard. One gotcha to watch out for is that the project name in that file has to match the Pages project name, or Git builds will fail. On top of that, once you declare the output folder in the config file, the dashboard stops being the source of truth for other build settings too, including the Node version. Since the default image ships with a Node version that’s too old for current Astro, I pin a current one explicitly.
My books and course files are too large to bundle into the build output, so I keep them in object storage instead. You can read more about my setup in the Cloudflare products I actually use and how the Pages build cache works. Here’s how the Cloudflare Pages setup looks:
4. A few serverless functions
For the handful of things that can’t be served as static files, I use small serverless functions. One handles the purchase webhook that assigns course access, and another lets past students request their links again. Newsletter signups, the sponsor form, and the one tool that calls a model all go through the same kind of function.
I keep shared helper modules outside the functions folder so Cloudflare Pages doesn’t publish them as public routes. Because the purchase webhook needs to verify a signature, I also have Node compatibility turned on for the project.
At one point I tried adding middleware that ran on every incoming request, but images and CSS went through it too, which turned every single page view into a metered call. I took it out, so now only those few routes run server code.
5. Storage, and the CLI around it
On the storage side, I use two key-value namespaces. The first maps a buyer’s email address to the course links they own, and the second stores short-lived counters so my forms and the AI tool can slow down abuse. Because KV is eventually consistent, it works well for course links and abuse counters, though it’s a bad fit for any number that has to be strictly exact.
All my books, plus a PDF and EPUB of every free course, live in R2 object storage on their own subdomain. The repo keeps a list of the files that should be there, and the production build fails if any course is out of date. Uploading those files is a separate step from building the site, and since there’s no egress fee, I don’t have to worry about costs when lots of people download PDFs.
I manage all of this from the terminal with Wrangler, including storing secrets so they never go into the repo. If you want to dig into any of these pieces, I’ve written short guides on KV, R2, and Wrangler, and my free Cloudflare course walks through the platform. Wrangler sits alongside the rest of the command line tools on my Mac, which I listed in The CLI tools I use every day.
6. Scheduled posts, published by a Worker
To schedule a post, I just give it a date in the future, which keeps it out of the build until that time passes. Of course, a static site won’t rebuild itself when a post’s timestamp arrives.
Because I publish three posts a day, I run a scheduled Cloudflare Worker shortly after each slot to trigger a Pages rebuild by sending a POST request to a deploy hook. The Worker checks the current time in Rome so the clock change twice a year doesn’t throw the job off by an hour. I also keep a GitHub Action around as a backup, though GitHub’s schedule is best effort and I’ve seen it run hours late.
I documented the whole setup in how I auto-publish scheduled posts. The annoying failure mode is when a build gets stuck as active and queues every other deploy behind it. I ran into that once and had to cancel one through the API.
7. Pagefind for search
Site search runs entirely in the browser using Pagefind. Right after the site build finishes, Pagefind reads the generated HTML and splits the index into small chunks so visitors only download the pieces their query needs.
I only index blog posts, leaving courses, tools, and the other pages out of the results. Inside the post layout, I mark the real content so Pagefind ignores the header and footer instead of matching them on every search. You’ll find the search box on /search and on the first page of the blog. I walked through the full setup in how I added search to my static site.
8. Plausible on a droplet
For analytics, I self-host Plausible’s community edition on a small DigitalOcean droplet using Docker Compose.
I set that server up back in 2023, and because a small machine has been plenty for my traffic, I’ve never needed to move to the hosted plan. I wrote down the installation steps in how to self-host Plausible, and years later I had Codex upgrade the box, which I covered in Updating self-hosted Plausible Analytics using AI. If you want the same host, you can sign up for DigitalOcean through my link (that’s an affiliate link, so I get credit if you become a customer).
One thing to keep in mind is that Plausible only sees browsers that run its script, so it won’t show you AI crawler traffic. For that, I look at the report in the Cloudflare dashboard.
9. The newsletter, and transactional email
My newsletter still runs on Sendy, a self-hosted PHP app on a small Ubuntu server on DigitalOcean, sending through Amazon SES. That exact pair was already in the 2018 post and is still going strong.
What did change is how signups reach it. My forms used to post straight to Sendy, until a bot abused that endpoint and subscribed a pile of addresses. Now every form hits one of my own functions first, which checks a Turnstile token, limits how often one IP can try, and only then talks to Sendy using a key the browser never sees. I wrote the full story in the newsletter spam attack.
That Ubuntu server has also given me a few debugging posts. Running Codex over SSH helped me track down a process the OOM killer kept shooting, a send that had slowed to a crawl, and later a disk filled by MySQL binary logs.
For transactional email, I use a separate service, Resend, called directly from my functions. That covers course access links, messages submitted through site forms, and the notes I send myself.
10. Paid courses
I sell my paid courses through Paddle, which acts as a merchant of record. It handles sales tax and invoices for me, and it sends the webhook that assigns course access.
11. Markdown for agents, and social images
Every published post on the site is also available as plain Markdown at the same URL with .md at the end:
curl https://flaviocopes.com/npm.md
The build writes one of those .md files for every post, and each HTML page points to its Markdown copy. I also generate a short index and a full index as static files, so serving them costs nothing at request time. Doing it on the fly at the edge would need a paid Cloudflare plan, whereas generating them at build time keeps it free. I explained the reasoning in serving my site as Markdown to AI agents, and I also allow AI crawlers in my robots file, which I talked about in robots.txt in the age of AI crawlers.
For a while every post got its own generated social image, but that made deploys heavy. Today, articles share one compact image unless a newer post brings its own custom one, like this post does, while courses, tools, and topic pages still get generated cards. If you’re curious how the old setup worked, I wrote it up in how I generated Open Graph images.
12. Sponsors
I display sponsors in a column on the site. On a phone it collapses into a thin strip, and on a wide screen it sticks to the right while you scroll. The current sponsor is Creem.
13. Browser tools
The site also has a tools section built with Alpine.js. Each tool lives in its own folder and runs right in the browser.
Only one of them calls a model, which is the app idea generator. Before calling a small model, it checks a Turnstile token and makes sure it’s still under a daily cap. You can read the launch post in New: 90 free tools for developers, back from when the section was smaller, and if you want to learn the library behind them, there’s a free Alpine.js course.
14. Free courses
My free courses live in a second content collection. All the lessons are Markdown, the quizzes run right inside the page, and your progress stays in the browser, so you never need an account.
Every course also ships as a PDF and an EPUB. I generate those files separately and upload them next to the books, while the site build only checks that they’re current. That way the build machines never need a TeX install. I announced the collection in I just published 55 free courses for developers.
15. Coding agents
I write most of the code in this repo with coding agents. Day to day I use Cursor, and I switch to Claude Code or Codex whenever one of them fits the task better. When the work happens directly on a server, I run the Codex CLI over SSH.
The repo includes an AGENTS.md file with the project details an agent would otherwise learn the hard way by breaking a build. I wrote more about what goes into that file.
On every commit, a Git hook appends a line to a plain text work log grouped by date and project, and the agents take care of installing that hook. You can see the full setup in how I log every Git commit to a plain text file.
For local development, I run the site through Local Hoster, a tool of mine that gives the project a stable local HTTPS URL.
What stayed out
There’s no CMS in front of the blog. Posts live as Markdown files in a private repo, so I write them in my editor and publish with a Git push. Courses, tools, and data files all work the same way. If you want a CMS on the same Cloudflare setup, you can use EmDash.
On the frontend, Alpine.js only shows up on the tool pages. A regular post is just HTML, CSS, a dark mode toggle, and a diagram script when that post includes a diagram.
I don’t run comments, and I don’t maintain a server for the site itself. Only two machines stay up, one for analytics and one for the newsletter, because that software can’t be served as static files. Everything else is either a file from the build or a Cloudflare service. I listed what each piece costs in what it costs me to run a one-person business.
Out of everything from 2018, the Markdown files and the newsletter are the pieces that are still here. Everything around them, from the hosting and the build to the small functions, is plain config I can open and change whenever I need to.
Want me to talk about your product? You can sponsor this site.