Blog

How this site is put together

A short colophon — what the site runs on, why it costs nothing to host, and how to add a post, a picture, a video, or an equation.

2 min read · Notes


This page is a colophon and a test card. If everything below renders correctly, the site is working.

The shape of it

Every page here is plain HTML, generated ahead of time and served from GitHub Pages. There is no server, no database, and no framework running in your browser. The only script on the page is about four hundred bytes that swaps in a YouTube player when you click one.

Writing a post means adding a Markdown file to src/content/blog/ and pushing it. A GitHub Action rebuilds the site in under a minute. Nothing else.

Mathematics

Equations are written between dollar signs and rendered at build time — the browser receives typeset HTML, never a formula and a rendering engine. Inline like ∇⋅v=0\nabla \cdot \mathbf{v} = 0, or displayed:

∂c∂t=D ∇2c  −  ∇⋅(v c)  +  R(c)\frac{\partial c}{\partial t} = D\,\nabla^{2} c \;-\; \nabla \cdot (\mathbf{v}\,c) \;+\; R(c)

An advection–diffusion–reaction equation, which is very nearly the whole of my working life. For anything with more structure, the usual environments hold:

κ1,κ2=principal curvaturesH=12(κ1+κ2)K=κ1κ2\begin{aligned} \kappa_{1}, \kappa_{2} &= \text{principal curvatures} \\ H &= \tfrac{1}{2}(\kappa_{1} + \kappa_{2}) \\ K &= \kappa_{1}\kappa_{2} \end{aligned}

Code

Syntax highlighting also happens at build time.

import numpy as np

def mean_curvature(vertices, faces):
    """Discrete mean curvature via the cotangent Laplacian."""
    laplacian = cotangent_laplacian(vertices, faces)
    areas = mixed_voronoi_areas(vertices, faces)
    return np.linalg.norm(laplacian @ vertices, axis=1) / (2.0 * areas)

Pictures

Images are referenced by a short identifier rather than a URL, and resized on delivery — one upload of the original serves every screen size.

Photograph
Field · 2023Addressed by id, not by URL.

A handful of pictures that support a post, rather than carry it, can sit in a gallery that stays folded until you open it. Each thumbnail opens the full photograph.

Video and audio

Video is never hosted here. A directive takes a YouTube id or a share link and renders a poster frame; the player itself loads only if you press play. The page fetches one thumbnail from YouTube’s image host, and nothing else — no player, no tracking cookies — unless you ask for it.

Play video: A clip.
ArchiveA clip.

Audio works the same way, and can also play a file directly for short clips where a video frame would be the wrong shape.

Adding to it

To addDo this
A blog postNew .md file in src/content/blog/
A few photos in a postA :::gallery block of ::img lines, folded until opened
A paperPaste the BibTeX block into src/data/papers.bib
A projectNew .md file in src/content/work/

That is the whole system.

  1. The shape of it
  2. Mathematics
  3. Code
  4. Pictures
  5. Video and audio
  6. Adding to it

meta · notes