This site’s blog is a client-side markdown engine: posts are single source of truth in _posts/ as .md files, and nothing is pre-rendered to HTML at build time. Here’s how it fits together.
Single source of truth
All posts live in _posts/ with date-prefixed filenames (YYYY-MM-DD-slug.md). There is no duplicate HTML copy. The browser fetches the markdown file for the post you’re viewing and renders it on the client.
Index and manifest
The listing (blog index page) needs metadata: title, date, slug, excerpt, etc. That comes from:
js/posts-index.json— Generated bynpm run generate-index. It’s a JSON array of post metadata. The engine loads this first. One request, full list, already sorted by date._posts/manifest.json— Fallback. If the index fetch fails (e.g. missing or wrong path), the engine fetches this file, which is a simple array of filenames in the same order as the index. It then fetches each.mdfile, parses front matter, and builds the list in memory. Same script that generates the index also writes the manifest so they stay in sync.
So: index for fast listing; manifest so the site still works if the index isn’t there.
Loading a post
When you open a post (e.g. journal/post.html?slug=how-this-blog-engine-works):
- The engine already has (or loads) the posts list, finds the entry for that slug, and gets the filename (e.g.
2026-03-05-how-this-blog-engine-works.md). - It fetches
_posts/<filename>.mdwithfetch(). - It parses front matter (the
---block at the top) for title, date, excerpt, optional multilinescene: |, and treats the rest as markdown. - Optional
scene(DM_READS) andtldr(TL;DR, orexcerptiftldris omitted) render above the article; the index and meta tags still useexcerpt. - Previous / Next links (and Ctrl+← / Ctrl+→) walk the published list—previous = older entry, next = newer.
- The markdown is rendered to HTML in the browser (this site uses marked from a CDN).
- The resulting HTML is injected into the page and meta tags are updated for sharing.
No server-side rendering. No static HTML for each post. Just markdown over the wire and client-side render.
Why .nojekyll?
The site is hosted on GitHub Pages. By default, Jekyll treats _posts and other underscored folders in special ways. A .nojekyll file in the repo root tells GitHub Pages to serve the site as plain static files. That way _posts/*.md are served as-is and our client can fetch() them. Without it, you might get redirects or processing that break the simple “fetch markdown, render here” model.
Workflow
- Write or edit a post in
_posts/(with or without YAML front matter; the generator can derive metadata from filename and first#heading). - Run
npm run generate-indexsojs/posts-index.jsonand_posts/manifest.jsonare updated. - Push — the site works. New and updated posts appear in the list and load when you open them.
That’s the engine: markdown in _posts/, index (and optional manifest) for the list, client fetch + parse + render, and one command to keep the index up to date.
Scheduled posts (a future date in front matter) are filtered client-side: they do not appear in the listing and show a "scheduled" notice when opened by direct link until the publish date (UTC). The engine supports scheduled visibility by date in addition to the rest above.