Using Codex to Rebuild My Blog and Import 15+ Years of Blogger Posts Source
Markdown source
1---2title: "Using Codex to Rebuild My Blog and Import 15+ Years of Blogger Posts"3date: "2026-03-28"4published: true5tags: ["codex", "ai", "blog", "php", "markdown", "docker", "automation"]6author: "Gavin Jackson"7excerpt: "How I used Codex to rebuild gavinj.net as a lightweight PHP and Markdown blog, import years of old Blogger posts, and help with both development and deployment."8---910# Using Codex to Rebuild My Blog and Import 15+ Years of Blogger Posts1112Over the last few weeks I used Codex to help me rebuild **gavinj.net** from scratch.1314The goal was not to create a giant CMS or a complicated devops pipeline. I wanted something much simpler: a fast, lightweight blog that I could understand end to end, host cheaply, edit easily, and keep under my own control.1516I also wanted to bring across a large archive of old Blogger posts without turning the migration into a months-long cleanup project.1718Codex ([https://openai.com/codex/](https://openai.com/codex/)) turned out to be very good at exactly this kind of work.1920## What I Wanted2122My requirements were pretty straightforward:2324- no database25- no heavy framework26- content stored as plain files27- local development that was easy to run and easy to throw away28- a design that felt clean and personal rather than looking like a default theme29- a practical migration path from Blogger into the new structure3031That led to a simple architecture:3233- PHP for rendering34- Markdown files with YAML frontmatter for content35- a `posts/` directory as the source of truth36- Docker Compose for local testing37- a minimal production deployment on Apache with PHP3839None of those choices are exotic, and that was the point. I wanted boring, understandable technology.4041## Why Codex Worked Well4243What impressed me most was not that Codex could generate code. Plenty of tools can do that now.4445What mattered was that it worked well as a collaborator across the whole lifecycle:4647- helping scaffold the initial PHP blog engine48- refining the layout and visual style over multiple iterations49- adding features like RSS, tags, source viewing, and draft support50- writing migration scripts for the old Blogger archive51- helping reason through local dev and deployment setup52- handling small but annoying infrastructure details that usually slow projects down5354That combination is where tools like this become genuinely useful.5556## Building the New Blog5758The first step was creating a minimal blog engine instead of dropping in WordPress or another full CMS.5960Codex helped build a simple PHP application that:6162- scans the `posts/` directory for Markdown files63- parses YAML frontmatter64- renders posts into HTML65- builds the homepage, post pages, RSS feed, and tag views66- keeps everything file-based and easy to inspect6768Using Markdown for articles was one of the best choices in the whole rebuild. It means the content is portable, easy to diff in Git, and pleasant to edit without needing a browser-based admin interface.6970Each post is just a file with metadata at the top:7172```markdown73---74title: "Example title"75date: "2026-03-28"76tags: ["php", "markdown"]77author: "Gavin Jackson"78excerpt: "Short summary for listings."79---80```8182That gives me a format that is simple enough to maintain manually, but structured enough to support tagging, excerpts, draft handling, and publication dates.8384## Iterating on the Design Together8586The design did not appear fully formed in one shot.8788This was much more of a back-and-forth process, which is exactly how real development usually works. We started with a clean dark layout, then kept refining it:8990- spacing91- typography92- post cards93- navigation94- accent colors95- mobile behaviour96- the tag cloud97- source view rendering98- the resume page99100This was one of the more useful patterns with Codex. I could say things like "this feels too generic", "move that into the sidebar", or "make the hover accent match the site branding", and then iterate quickly from there.101102It felt less like using a code generator and more like pairing with someone who can make changes quickly once the direction is clear.103104## Importing the Old Blogger Archive105106The second major problem was content migration.107108I have a lot of old posts going back many years, and I did not want to manually copy and paste them into the new system. Codex helped create an import script that pulled entries from the Blogger Atom feed and turned them into local post files.109110The first pass imported legacy posts with frontmatter and preserved the original HTML body. That was a smart intermediate step because it got the archive into the new framework quickly without blocking on perfect conversion.111112From there, I could progressively improve the content instead of trying to solve everything up front.113114The import process included things like:115116- extracting titles and publication dates117- generating slugs118- capturing categories as tags119- storing original publication timestamps120- preserving legacy URLs121- generating excerpts automatically122123That meant the old archive became part of the new site structure almost immediately.124125## Converting Old HTML to Markdown126127Once the import was done, the next step was improving the archive quality.128129A lot of older Blogger posts were HTML-heavy, which is normal for content that has lived through multiple platforms and editors. Codex helped write a second migration script to convert those imported HTML posts into cleaner Markdown.130131That script handled:132133- headings134- paragraphs135- lists136- links137- blockquotes138- inline code and code blocks139- embedded images140- special handling for old monospace code spans141142It also materialised image assets into the local repository so the new site was no longer dependent on external hosted content for every imported image.143144That was a good example of where AI assistance saved real time. Writing and refining HTML-to-Markdown conversion logic is fiddly work. It is not impossible, but it is exactly the kind of task where having a fast coding partner is valuable.145146## Local Development with Docker Compose147148I wanted local testing to be easy and disposable, so we added a local `docker-compose.yml` setup with `nginx` and `php-fpm`.149150That gave me a repeatable dev environment that I could start with:151152```bash153docker compose up --build154```155156The setup also included:157158- a custom PHP image159- Composer installed in the container160- automatic dependency installation on first start161- bind mounts for live editing162- a named volume for `vendor/` so dependencies persisted across restarts163164That is exactly the kind of practical quality-of-life improvement I appreciate. It meant I could work on the site without having to remember local PHP versions, install steps, or one-off machine setup.165166## Deployment Help Matters Too167168One thing I want to emphasize is that Codex was not only useful for writing the application.169170It was also helpful in the deployment phase.171172Once the site itself was in good shape, I still needed to get it running properly in production. That included things like:173174- Apache virtual host configuration175- rewrite rules176- PHP module setup177- checking the right pieces were enabled178- getting Let's Encrypt SSL certificates in place179- generally closing the loop from "works on my machine" to "actually live"180181That part is often underappreciated when people talk about AI coding tools. Real projects do not stop at code generation. There is always a layer of server configuration, packaging, permissions, services, and certificates that has to be sorted out before a site is genuinely done.182183Having help there was just as valuable as having help with the PHP and CSS.184185## What I Still Liked About Being in Control186187Using Codex did not mean handing the project over and hoping for the best.188189I still made the architectural choices. I still reviewed the code, decided what to keep, adjusted the content, and steered the design. The value came from compressing the implementation and iteration time, not from removing human judgment.190191That is probably the best way to think about tools like this.192193They are strongest when:194195- you know roughly what you want196- you can review the output197- you are willing to iterate198- you want to move faster through the boring or fiddly parts199200For me, that was exactly the situation here.201202## The Result203204The end result is a blog that feels much closer to what I wanted all along:205206- lightweight207- easy to host208- Git-friendly209- based on plain files210- easy to extend211- easier to maintain than my old setup212- capable of carrying both new writing and old archive content213214Just as importantly, the process was enjoyable.215216Instead of getting bogged down in boilerplate, migration drudgery, or deployment trivia, I could keep making decisions and moving forward. Codex handled a lot of the implementation load, but still left me in control of the final shape of the site.217218That is the part I think people sometimes miss. The best use of tools like this is not pressing a button and walking away.219220It is collaborating with them to get better results faster.221222And for this rebuild, that worked remarkably well.223