Rebuilding this site as a static Astro build
Why divine-coding.com moved off WordPress to a static Astro build, and what the architecture decisions behind it actually buy.
The previous version of this site was WordPress running a purchased portfolio theme. It worked,
but it carried a lot of weight for a personal site: a database, a PHP runtime, an admin surface to
patch, oversized theme images, and no blog at all. The /blog/ route returned a 404 while the
writing lived on Medium.
This version is a static build. No database, no PHP, no admin panel to keep patched.
The shape of it
Astro renders every page to HTML at build time. Content lives in Markdown and MDX files inside the repository, validated by a Zod schema per collection:
professionalCaseStudiesfor client and employer workpersonalProjectsfor public repositoriesblogfor articles
Each case study carries an explicit evidence grade. HIGH means the source material documents the architecture, so the page can describe it in full. MEDIUM means the approach and outcome are documented but parts of the design are not, so those parts are simply left out. LOW means the material is thin, and the entry stays short instead of being padded with invented detail.
That grading is the most useful thing about the rebuild. A portfolio that claims less, precisely, is more convincing than one that claims everything vaguely.
Scheduled publishing without a runtime
I wanted to write ahead of time without publishing early. There is no scheduler in a static build, so the filter runs during the build:
export async function getPublishedPosts() {
const now = new Date();
const posts = await getCollection(
'blog',
({ data }) => data.draft !== true && data.pubDate.getTime() <= now.getTime()
);
return posts.sort((a, b) => b.data.pubDate.getTime() - a.data.pubDate.getTime());
}
A GitHub Actions workflow rebuilds the site on every push to main and once a day on a cron. The
daily rebuild is the scheduler: a post dated in the future is in the repository, but invisible until
the build runs after its date.
What it costs
Almost nothing at runtime. The pages are HTML and CSS, with a few small inline scripts — a scroll-reveal observer, a tag filter — and no client-side framework. Fonts are self-hosted variable files, so there is no third-party request on page load and nothing to consent to.
The trade is that publishing means a commit. For a personal site updated a few times a month, that is cheaper than maintaining a CMS.