How I Built This Blog with Cloudflare Pages

Back to blog

This blog is fully static, completely version-controlled, and hosted on Cloudflare Pages. It uses AsciiDoc for content, and it’s 100% JavaScript-free. Here’s how I set the whole thing up.

1. Why AsciiDoc?

2. Project Structure

blog/
    ├── index.adoc
    ├── posts/
    │   ├── post1.adoc
    │   ├── post2.adoc
    ├── custom.css
    ├── build.sh
    └── _site/         # final output (what Cloudflare serves)

3. The Build Script

The script compiles each .adoc file using asciidoctor:

#!/bin/bash

    rm -rf _site
    mkdir -p _site/posts

    for file in posts/*.adoc; do
      asciidoctor "$file" -o "_site/posts/$(basename "${file%.adoc}.html")"
    done

    asciidoctor index.adoc -o _site/index.html
    cp custom.css _site/

Make it executable:

chmod +x build.sh

4. Styling

AsciiDoctor has great defaults, but I added a minimal custom.css for:

h2, h3 {
      color: #c0392b;
    }

    @media (prefers-color-scheme: dark) {
      body {
        background-color: #121212;
        color: #dddddd;
      }
    }

5. Deploying to Cloudflare Pages

Cloudflare makes it stupidly easy.

  1. Connect your GitHub repo
  2. Set build command to ./build.sh
  3. Set output directory to _site
  4. Done. It builds on every git push

6. Why This Rocks

Final Thoughts

Most blogs are overengineered. Mine is aggressively underengineered - and that’s the point.

If you want a blog that feels like writing a README file, but looks like a clean academic site, this setup slaps.