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 on, or lawsonhart.me if you’re reading this somewhere else. There’s a public template version that strips out the parts I’d rather not hand out, mostly the Spotify and analytics wiring tied to my own accounts. This post covers what’s left in it and what you can do with it.
Repo’s here:
What it’s for
A personal site repo. Blog posts (you’re in one), an about page, and personalization hooks throughout. The pieces a personal site needs and not much past that.
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 match on them. Technologies get deduped case-insensitively for the same reason. Drafts get filtered out so they never build or render in production.
The technologies field is worth calling out. It drives the tech icon row on post cards, and it gives you a second axis to organize posts on when tags start doing too much.
Markdown and MDX
I write in Markdown and MDX but I still want 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 indexing adds seconds to every local rebuild. On the live site the results are styled to match everything else instead of looking like a widget someone pasted in.
This suits a blog template well. 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. Once the route exists, every post has a finished preview image the moment you publish it, with no design step and no forgotten placeholder showing up in a Discord embed. 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 point at your accounts instead of mine.
Posts go under src/content/post/**, notes under src/content/note/**. Follow the frontmatter shape already in the repo, especially title, description, publishDate, tags, and technologies. Keeping those consistent is why 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