My blog site or alternatively https://gabinson200.github.io/blog/mindmap.html
RSS: https://gabinson200.github.io/blog/feed.xml
semantic.html places articles by meaning. You enter 1, 2, or 4 concepts and articles
are plotted by their similarity to them. It reads semantic-index.json, which holds the
chunk embeddings of every article in articles.json.
The index is rebuilt automatically by the "Update Semantic Index" GitHub Action whenever
a markdown file or articles.json changes. To rebuild it locally (Node 20+):
npm install
npm run build:embeddings # only re-embeds articles whose markdown changed
npm run build:embeddings -- --force # re-embed everythingThe first run downloads the Xenova/all-MiniLM-L6-v2 model (about 23 MB) into .cache/.
Articles with "commentary": true in articles.json (or commentary: true in
their front matter) are laid out like a Talmud page: the article in the centre,
visitors' notes in the margins beside the paragraph they're about. On narrow
screens, or with the margins hidden, each paragraph with notes gets a "3 notes"
toggle instead. Readers hover or tap a paragraph and press + to write.
- Front end:
scripts/marginalia.jsandmarginalia.css, loaded byarticle.html. - Back end:
worker/index.js, a Cloudflare Worker with a D1 database (worker/migrations/). It checks every note with Cloudflare Turnstile and limits each visitor to 5 notes per 10 minutes and 30 a day. Notes are plain text, 1,000 characters at most. - Notes are tied to a fingerprint of their paragraph's text. If you rewrite a paragraph, its notes move to "notes on earlier versions" at the end of the article.
- On GitHub Pages or a plain local server there's no API, so the margins say they're unavailable and nothing breaks.
Deleting notes: open any article on the site, run this once in the browser console, and a Delete link appears on every note:
localStorage.setItem('marginaliaAdminKey', '<your ADMIN_KEY>')Local development (uses Cloudflare's always-pass Turnstile test keys from
.dev.vars, which isn't committed):
npx wrangler d1 migrations apply blog-notes --local
npx wrangler dev # http://localhost:8787The whole repository is the site: wrangler.jsonc serves every file as a
static asset (except what .assetsignore lists) and runs worker/index.js
only for /api/*. Static files are free and unlimited; the API fits Workers'
free plan (100,000 requests a day).
One-time setup:
- Domain: buy one in the Cloudflare dashboard (Domain Registration), or add a domain you already own to Cloudflare.
- Log in:
npx wrangler login - Database:
npx wrangler d1 create blog-notes, put thedatabase_idit prints intowrangler.jsonc, then create the table:npx wrangler d1 migrations apply blog-notes --remote - Turnstile: in the dashboard, Turnstile > Add widget, hostname = your
domain. Put the site key in
wrangler.jsonc(TURNSTILE_SITE_KEY) and store the secret key:npx wrangler secret put TURNSTILE_SECRET - Admin key: pick a long random string and store it:
npx wrangler secret put ADMIN_KEY - Deploy on every push: Workers & Pages > Create > Import a repository >
this repo (deploy command
npx wrangler deploy). Or deploy by hand withnpx wrangler deploy. - Custom domain: the Worker's Settings > Domains & Routes > Add > Custom domain.
Moving off GitHub Pages:
- In the GitHub repo, Settings > Secrets and variables > Actions > Variables:
add
NEW_SITE_ORIGIN=https://your-domain(no trailing slash). - Settings > Pages > Source: GitHub Actions. The "GitHub Pages redirect"
workflow then replaces the old site with pages that forward every
gabinson200.github.io/blog/...URL to the same path on the new domain, and keeps copies offeed.xml,webring.jsonand the webring widget, so RSS readers and members' webring snippets keep working. - Run the "Auto-Update RSS Feed" workflow once (Actions tab), so the feed's links use the new domain.
- Change your own entry in
webring.jsonand the links at the top of this README to the new domain.