TODO: Why I started writing things down

TODO: The card blurb, the meta description, and the RSS summary all come from this one field. One or two sentences.

TODO: Replace this file with your own writing. It exists so the Writing section is not empty the first time you run the site, and so you can see how a post looks before you have written one.

The file is plain Markdown. There is no front matter to keep in sync — the title, date, tags and summary all live in the writing array in src/content/site.ts, which is also what the RSS feed and the sitemap read.

How a post gets on the site

Two steps, and neither of them touches a route or a template:

  1. Save a Markdown file in src/content/articles/, for example my-post.md.
  2. Add one entry to writing in src/content/site.ts with bodyFile: 'my-post.md' and a matching slug.

That is it. The post now appears on the home page, on /writing, in /feed.xml, and in /sitemap.xml.

What Markdown you can use

Everything GitHub-flavoured Markdown supports, because that is how marked is configured in src/services/articles.ts.

Headings become deep-linkable — hover one and you get an anchor. Inline code works, and so do fenced blocks:

// The reading time on each post is computed, not maintained by hand.
const WORDS_PER_MINUTE = 220;
const minutes = Math.max(1, Math.round(wordCount / WORDS_PER_MINUTE));

Blockquotes are styled, which makes them useful for the one line you actually want a reader to remember.

Lists work as you would expect:

  • Ordered and unordered
  • Nested, if you must
  • With inline code and links

Tables work too:

Thing Where it is configured
Title, date, tags src/content/site.ts
The words this file
How Markdown renders src/services/articles.ts

Why the words are not in the database

Because there is no database, and for a personal site there does not need to be one. Markdown files in git give you version history, diffs, offline editing, and grep. Adding a database would mean a schema, a migration story, a connection pool, and a backup plan — all so you can write three posts a year.

That is the general shape of the trade in this project: pick the boring option until the boring option actually hurts.

Related