summaryrefslogtreecommitdiff
path: root/blog/how-this-site-works.qmd
blob: d142a59ac87999516a618d7f17770f06f239ef7b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
---
title: "How This Site Works"
date: "2026-08-05"
---

## WHY

I wanted publishing to be easy, and I wanted this site to
work from a terminal. You should be able to `curl jayrup.me`
and read the whole thing as plain text — no browser needed.

This is the pipeline that makes that happen.

## HOW

Everything lives in one git repo, hosted on meru, my server
at home. That repo is the source of truth. My agents on
archbook (my laptop) and voidlaptop (an old laptop I turned
into a server) push to it — and a push to main is a deploy.

The repo is public, so the site and the code behind it are
both out in the open.

## STACK

- every page is a `.qmd` file
- Quarto renders each one twice: HTML for browsers,
  plain text for curl
- a post-receive hook on meru runs that render inside a
  Docker container, then rsyncs the result to the VPS
- nginx on the VPS checks the user-agent: curl gets
  `.txt`, browsers get `.html`

## SOURCE OF TRUTH

The repo is self-contained and public — browse the
source or clone it:

- Web: [git.jayrup.me](https://git.jayrup.me)
- Clone: `git clone https://git.jayrup.me/git/homepage.git`

`blog/` holds these posts as flat `.qmd` files;
`blog/index.qmd` is the listing page, newest first.

## PUBLISHING

1. Write `blog/<slug>.qmd` with a title and date
2. Add an entry to `blog/index.qmd`
3. Push to meru — the post-receive hook renders the site
   in a Docker container and rsyncs it to the VPS
4. Verify: `curl https://jayrup.me/blog/<slug>` —
   you'll get plain text, which is the point

## WHY THIS WORKS

The deploy script finds every `.qmd` recursively, so new
posts need zero script changes. Builds run from a git
snapshot of the exact commit you pushed, so what goes
live is always what's in the repo. And each deploy
stamps `last-deploy.txt` with the commit, so the site
shows you what's actually live.

That's the whole pipeline: a repo, a render script, and
nginx. The code is all in the repo if you want to poke
at it.

--------------------------------------------------

BACK: curl [jayrup.me/blog](https://jayrup.me/blog) | curl [jayrup.me](https://jayrup.me)