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:
- Save a Markdown file in
src/content/articles/, for examplemy-post.md. - Add one entry to
writinginsrc/content/site.tswithbodyFile: 'my-post.md'and a matchingslug.
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 codeand 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
TODO: An article you published somewhere else
TODO: External posts live in the same list. The card links straight out, and /writing/<slug> redirects there so a shared link never dead-ends.