How the nurazhar.com blog ships: 610 lines, no framework

Answer

The blog is a 431-line Node script plus a 179-line layout module. Neither has a dependency: 182 posts and 431 diagrams become 648 files in 277 ms. Cloudflare Pages serves those files with nothing running at the edge.

  1. A post is frontmatter plus HTML, so no Markdown engine ships.1
  2. Diagram art is compiled once into a gzipped bundle, then expanded by the build.2
  3. Stylesheets, icons and the Open Graph image are content-hashed, so the edge caches them for a year.3
  4. Deploy is a push: Pages runs npm run build and publishes dist, so no upload step exists.

Applies tonurazhar.combranch mainone build, 277 ms

1

What goes into the build?

Five inputs feed build.mjs, and each has one job. Nothing else is read at build time.

InputJobAmount
src/content/blog/*.mdFrontmatter plus HTML body, one file per post182 files
src/pages/*.htmlBody of index, hire, agentic-ai-security and 4044 files
src/styles/global.cssThe only stylesheet62,989 bytes
src/archify/Page shell and gzipped diagram bundle709,245 bytes
public/Assets, _headers, _redirects, llms.txtcopied as-is
Where each input sits
Diagram structure
  • nurazhar-com root
  • build.mjs bm
  • src src
  • content/blog blog
  • pages pages
  • archify arch
  • public pub
  • root → bm
  • root → src
  • src → blog
  • src → pages
  • src → arch
  • root → pub

The post format is the unusual part. A file opens with a --- block of keys, then the body is HTML such as <figure>, <h2> or <table>. Two hand-written functions read those keys and keep the body verbatim, so the build never needs a parser dependency.1

1build.mjs:44–60
function parsePost(filePath) {
  const raw = fs.readFileSync(filePath, 'utf8');
  const match = raw.match(/^---\r?\n([\s\S]*?)\r?\n---\r?\n([\s\S]*)$/);
  if (!match) throw new Error(`Missing frontmatter in ${filePath}`);
  const data = {};
  for (const line of match[1].split(/\r?\n/)) {
    if (!line.trim()) continue;
    const idx = line.indexOf(':');
    if (idx === -1) continue;
    const key = line.slice(0, idx).trim();
    data[key] = parseScalar(line.slice(idx + 1));
  }
  const id = path.basename(filePath, '.md');
  return {
    id,
    title: String(data.title ?? id),
    description: String(data.description ?? ''),
2

Which stage does what?

The build is ten steps in a fixed order. Two of them decide everything downstream: dist is emptied first, and the post list is sorted before any page renders.

build.mjs, in the order it runs
Diagram structure
  • Empty dist wipe
  • Copy public pub
  • Expand 431 diagrams arch
  • Hash CSS and OG hash
  • Sort posts by order sort
  • Render 5 pages pages
  • Render 182 posts posts
  • Feed and search index feeds
  • Sitemaps and llms maps
  • arch → hash
  • feeds → maps
  • hash → sort
  • pages → posts
  • posts → feeds
  • pub → arch
  • sort → pages
  • wipe → pub

The sort key is order descending, then pubDate, then id. One array of posts then feeds five outputs: the blog index, feed.xml, search-index.json, both sitemaps and llms-full.txt.1

3

How does one post become one page?

parsePost returns an object; renderLayout wraps it in the document. The layout sets the canonical URL from the slug, emits Open Graph and Twitter tags, and inlines a theme script before first paint so the page never flashes the wrong colour.4

The body is inserted without escaping, which is why posts are authored as HTML. A title and a description are escaped, because they come from frontmatter.

Nothing else is per-post. There is no pagination, no tag route and no related-posts query: _redirects sends /blog/* and /tag-* to /blog.

4

How do 431 diagrams reach 141 posts?

A manifest is a JSON list of components, connections and cards. The compiler renders each entry through the Archify CLI, writes one file per diagram, and appends a record to a gzipped bundle.

One diagram, from manifest to post
Diagram structure
  • manifests.json mf
  • compile-archify.py cc
  • shell and ndjson bd
  • build.mjs bm
  • iframe in post if
  • mf → cc · 427 plus 4
  • cc → bd · 431 records
  • bd → bm · expand
  • bm → if · dist/archify

The bundle holds the 29,264-byte page shell once, and 679,981 gzipped bytes for all 431 diagrams. At build time five string replacements fill the shell: title, heading, explanations, SVG and cards. That is the whole renderer.

Each post embeds the result as an iframe. A resize observer in the layout gives every frame the height of its own document, so a figure never hides behind an inner scrollbar.4

5

What lands in dist?

Everything is static. There is no function, no middleware and no server process.

KindFilesProduced from
HTML619182 posts, 5 pages, 431 diagrams, 1 standalone explainer
CSS2global.css hashed, plus the shared diagram viewer
JavaScript4search.js, webmcp.js, viewer and theme
XML3feed.xml, sitemap-0.xml, sitemap-index.xml
Text4llms.txt, llms-full.txt, robots.txt, humans.txt

648 files in total, and dist is deleted before every build, so a removed post cannot leave a page behind.

6

How does it reach the edge, and how is that proven?

The Pages project builds on push to main and publishes dist. _headers adds the security headers, and marks fonts, styles.*.css and og.*.png as immutable for a year. The root also carries a Link header that points at llms.txt. _redirects holds 23 rules for legacy paths.3

7

Is a Common Lisp rewrite warranted?

No. The pipeline is 610 lines with no dependencies, builds in 277 ms and runs nothing at the edge. A rewrite must delete code, not translate it.

Pipeline code
610 lines of JavaScript
Dependencies
none in package.json
Build
277 ms for 648 files
Edge runtime
none

One measured defect exists, and it does not need a new language. llms.txt is static and claims 181 posts while the build holds 182; llms-full.txt is generated and already prints the true count. Three emitted lines would end the drift, which is less code than today.1

8

What should a change leave behind?

Opening diagram…