The blog post about this blog
A tour of my lawsonhart.me Astro codebase, what ships in the public template, and what stays site-only.
Try it live (opens in a new tab)The site you’re looking at right now
This one’s about the repo behind the site you’re currently on, or lawsonhart.me if you’re reading this somewhere else. There’s a public template version of it that leaves out the private stuff I’d rather not hand out, for various reasons, and this post covers what’s actually in it plus some things you can do with it.
Repo’s here:
What it’s for
It’s a personal site repo, pretty obviously. Blog posts (you’re in one), an about page, and personalization hooks throughout. Nothing exotic, just the pieces a personal site actually needs.
Posts and notes
Both run on Astro Content Collections, with tags, technologies, cover images, and drafts as frontmatter attributes. Tags get lowercased because a few features around the site depend on that. Technologies get deduped case-insensitively, again because other features lean on them. Drafts get filtered out so they never build or render in production.
The technologies field is worth calling out. It drives the little tech icon row on post cards, and it’s a nice second way to organize posts beyond tags.
Markdown and MDX
I write in Markdown and MDX but I still want some rules around it. The pipeline handles directive admonitions, heading ids with linked headings, safer external links, inline images through a public asset prefix, and Astro Expressive Code for the code blocks.
Search
Pagefind. The index builds after the site build in scripts/pagefind.mjs, and search stays off in dev because it slows local development down a lot. On the live site the results are styled to match everything else instead of looking like a widget someone pasted in.
This fits a blog template really well honestly. Search runs entirely client-side, so there’s no search service to run or pay for.
OG images
Posts get OG images from a route that renders them with Satori and Resvg. Small feature, goes unnoticed most of the time, adds a lot when it’s used right. Once the route exists every post gets a finished preview image with zero manual work, and you can still drop in a custom image when a post deserves one.
What stays site-only
The exclude list shifts as the site does. Right now it’s the Spotify widgets, the GitHub routes and stats, the Umami analytics proxy routes, the comments UI, and any posts or project content that wouldn’t make sense in a generic starter.
Making it yours
Edit src/site.config.ts and set the site url, title, author, and description. Then update the nav links and socials so the header and profile areas match your site instead of mine.
Posts go under src/content/post/**, notes under src/content/note/**. Follow the frontmatter shape that’s already in the repo, especially title, description, publishDate, tags, and technologies. Keeping those consistent is the whole reason the list pages and cards work without extra tweaking.
If you want something that isn’t in there
Email me. If one of the private components matters for your own site I can probably work something out and get you the code.
Email: me@lawsonhart.me