Writing

Web Development · 3 min read

How Claude Code Built This Blog - Part 2

Claude Code helped build the parser, generator, templates, and Cloudflare deployment. Syntax highlighting and timezones took more work.

In this article6 sections

Looking back This describes the 2025 Bunki build. The site now uses Astro; the code and tooling choices below document that earlier implementation.

Claude Code got this blog from an architecture plan to a working deployment for $10. Syntax highlighting took several attempts, timezone handling needed custom filters, and I still ended up with code I could understand and change.

Part 1 covers how I got started and chose the architecture. This part covers the implementation and deployment.

Markdown Processing

parser.ts reads files with fs-extra, extracts frontmatter with gray-matter, converts markdown to HTML with marked, and sanitizes the output against XSS while preserving syntax highlighting.

The key decision is to register only the languages you need, which keeps memory low.

// Register only the languages needed
hljs.registerLanguage("javascript", javascript);
hljs.registerLanguage("typescript", typescript);
hljs.registerLanguage("markdown", markdown);
hljs.registerLanguage("python", python);
hljs.registerLanguage("json", json);

// Configure marked with syntax highlighting
const marked = new Marked(
  markedHighlight({
    emptyLangClass: "hljs",
    langPrefix: "hljs language-",
    highlight(code, lang, info) {
      const language = hljs.getLanguage(lang) ? lang : "json";
      return hljs.highlight(code, { language }).value;
    },
  }),
);

Claude also generated excerpts and added target="_blank" and security attributes to external links.

Static Site Generation

generator.ts orchestrates the build: reads markdown from the content directory, generates tag pages, renders Nunjucks templates to HTML, compiles SCSS to CSS with theme variables, and creates RSS feeds and sitemaps.

Templating

The Nunjucks setup includes a base template for shared HTML structure, separate templates for index, post, and tag pages, custom date filters for Pacific timezone formatting, and SCSS compilation with theme variables from config.

Where Claude Struggled

Syntax highlighting took several rounds. Claude’s first attempt at configuring highlight.js didn’t work. After back-and-forth, we landed on language-specific imports that performed well.

Timezone handling needed custom Nunjucks filters for consistent Pacific timezone dates.

Build and Deploy

The build commands in CLAUDE.md:

- Build: `npm run build`
- Development: `npm run dev`
- Generate static site: `npm run generate`
- Serve site: `npm run serve`
- Deploy to Cloudflare: `npm run deploy`

I used Claude to research Cloudflare Pages deployment, then deployed with wrangler.

What I Could Maintain Afterward

Watching Claude plan the generator taught me how the parser, templates, and deployment fit together. I could modify the TypeScript scripts and Cloudflare Pages setup without asking it to explain them again. Running /init also gave subsequent sessions the project commands.

I later moved the build from Node to Bun and the hosting from Pages to Workers. I could make those changes because I understood the starting point. My current division of work is in Claude Code: what I actually use.

Was this useful?

What was missing?

Thanks for the feedback.