Tristan's Blog

Sunday, 22 November 2026

installing this blog

how to install, write for, build and deploy this blog

A dew-covered spider web strung between bare twigs in a garden, with a pale green shed blurred in the background
Small, hand-spun, and held together by more threads than you would guess.

hello future tristan

updated november 2026: the blog now lives inside the triwats.com repo, uses its own newsprint theme, and ships as a cloudflare worker. the old archie + pages notes are gone.

install

  1. brew install hugo node imagemagick
  2. npm install from the repo root

hugo builds the blog, node runs the sveltekit site around it, and imagemagick handles photos and social cards.

run it locally

  1. npm run dev:blog - hugo dev server with drafts, for writing
  2. npm run dev - the main site on port 1313

gotcha: the homepage reads the blog feed from the last full build, so after changing posts run npm run build and restart npm run dev to see them there.

new content

use the helper, it’s easier

  1. cd blog && hugo new content content/posts/<my-new-thought>.md
  2. npm run dev:blog then read and find all the typos
  3. flip draft = true to false when it’s ready

it uses archetypes, which are essentially templates. new posts start as drafts.

photos

drop them in blog/static/images/ as webp, resized and with the exif stripped (phones put gps in there):

magick IN.JPG -auto-orient -resize 1600x1600 -strip -quality 80 blog/static/images/name.webp

camera raws (.DNG) need converting first: sips -s format tiff IN.DNG --out tmp.tiff, then run the line above on the tiff.

then plain markdown on its own line:

![alt text](/blog/images/name.webp "caption under the photo")

standalone images float into the text, alternating right then left. put {.full}, {.left} or {.right} on the next line to override, or {link="https://..."} to make it clickable.

the header photo is the image front-matter field, and imageCaption prints under it. make the caption a one-line takeaway, not a label.

social cards

npm run og builds the share card for every post. deploys don’t regenerate them, so run it after adding or editing a post and commit the cards.

build and deploy

  1. npm run build - builds the blog into static/blog/, then the sveltekit site
  2. npm run deploy - builds and runs wrangler deploy

it’s a cloudflare worker now, not pages. secrets go in with wrangler secret put <KEY>.

theme

the theme is blog/themes/newsprint, custom and in the repo, so there’s nothing to clone. archie is still in there as a leftover.

references

← All posts