reloading01

How this ledger works

Adding a post, filling in the front matter, and shipping it — three files, one push.

d9f0a3dce1b32 min

This site is an Astro project. Posts live in src/content/blog/ as Markdown, split into one folder per language:

src/content/blog/
├── tr/bu-defter-nasil-calisiyor.md
└── en/how-this-ledger-works.md

The folder name sets the language. Turkish posts are published at the root (/yazi/...), English posts under /en/post/....

Adding a post

Drop an ASCII-named .md file into the folder for its language — the filename becomes the last segment of the URL. Start it with this front matter:

---
title: The title of the post
description: One sentence for the list and for search results.
date: 2026-08-17T14:00:00Z
tags: [ct, tls]
---
Field Required What it does
title yes The title
description yes List summary and meta description
date yes Index number and feed date
updated no Set it when you revise a published post
tags no Tag pages are built from these
draft no true keeps it out of the build, visible in npm run dev
translationKey no Pairs the two language versions of one post

Write the same translationKey in both files and the row picks up a tr marker, while the language link in the header jumps straight to the translation.

Index numbers and digests

Each post gets an index from its publication date. Numbers are handed out oldest first, so a new post never renumbers the ones already published.

The twelve-character digest on each row is the first twelve hex characters of the SHA-256 hash of the file’s Markdown body. Fix a typo and the digest moves. You can run the same calculation yourself:

node -e '
  const fs = require("fs"), crypto = require("crypto");
  const body = fs.readFileSync(process.argv[1], "utf8")
    .replace(/^---\n[\s\S]*?\n---\n/, "")
    .trim();
  console.log(crypto.createHash("sha256").update(body).digest("hex").slice(0, 12));
' src/content/blog/en/how-this-ledger-works.md

The front matter is not part of the hash, only the body is, with surrounding whitespace trimmed. Changing the title leaves the digest alone; changing the text does not.

Shipping it

Push to main and GitHub Actions takes over: it installs dependencies, runs npm run build, and uploads the resulting dist/ folder to Pages. Built files are never committed.

To look at it locally:

npm run dev

Drafts show up only there; a post left at draft: true stays out of the build.

index
0002
written
digest
d9f0a3dce1b3

The digest is the first twelve hex characters of the SHA-256 hash of the post’s Markdown body. Change the text and the digest changes with it.