Code

Code · Case study

jeandedalmas.com rebuild

Ten years of project posts, moved off WordPress.com and onto a static site in GitHub.

The job

The old site was ten years of construction posts, galleries, and job-site videos on WordPress.com. The paid plan was the hosting, the theme, the database, and the media library, and every change went through the WordPress editor.

I wanted to keep every public post, photo, and video, and replace those four pieces with a codebase in GitHub, served by Cloudflare Pages.

flowchart TB
  classDef legacy fill:#f3f3f3,stroke:#8a8a8a,color:#262626
  classDef process fill:#eaf8f4,stroke:#1abc9c,color:#262626
  classDef current fill:#eff5f8,stroke:#547d91,color:#262626

  subgraph before["Before: WordPress.com"]
    direction TB
    oldDomain["jeandedalmas.com"]
    wordpress["WordPress.com hosting
theme + runtime"] wpContent[("Posts + pages
WordPress database")] wpMedia[("Photos + original videos
WordPress media library")] subscription["Paid hosting subscription"] oldDomain --> wordpress wordpress --> wpContent wordpress --> wpMedia subscription --> wordpress end subgraph migration["One-time migration"] direction TB api["WordPress public API"] archive["Python archive scripts
fetch + normalize"] content[("Astro content collections")] originals[("Original media archive")] ffmpeg["FFmpeg
AV1 encode, full resolution"] optimized[("Media under the 25 MiB
Pages file limit")] wpContent --> api wpMedia --> api api --> archive archive --> content archive --> originals originals --> ffmpeg ffmpeg --> optimized end subgraph after["After: Astro on Cloudflare"] direction TB source["Private GitHub repository
Astro + TypeScript"] build["Astro static build"] pages["Cloudflare Pages
global hosting"] dns["Cloudflare Registrar + DNS
jeandedalmas.com"] visitor["Visitors + crawlers
static HTML, images, video"] content --> source optimized --> source source --> build build --> pages dns --> pages pages --> visitor end class oldDomain,wordpress,wpContent,wpMedia,subscription legacy class api,archive,content,originals,ffmpeg,optimized process class source,build,pages,dns,visitor current

Before: a paid WordPress.com subscription served the live site. After: the same archive is a static Astro build on Cloudflare Pages, with the one-time migration pipeline in the middle.

How it works

Migration

Python scripts pulled every public post, page, and image through the WordPress API. The content went into Astro content collections, so the archive is static and no longer depends on WordPress. The site search reads the same collections.

Media

The original videos were over the host's per-file limit. FFmpeg re-encoded them to AV1 at their original pixel dimensions, which got each file under the limit without cutting any footage.

Build and deployment

Astro and TypeScript generate the site as static HTML. The source lives in a private GitHub repository, and Cloudflare Pages is connected to it: each push to the main branch builds the site and deploys it. There is nothing to upload by hand.

The few parts that need a server run as Cloudflare Pages Functions in the same repository: the contact form, and the address lookup on the Address records page.

Result

Every public post is still here. Design + Build and Code are now separate libraries, and there is no WordPress hosting plan to keep paying for. A change is a commit and a push.

Limits

There is no in-browser editor; every change, including a new post, goes through the repository. Every file Cloudflare Pages serves must stay under its 25 MiB limit, so the videos on the site are re-encoded copies, and the originals stay in the media archive rather than on the site.

Sources

View the rebuilt site