Post formatting reference
A scaffold post showing the Markdown, code, math, and table formatting available in posts on this site. Delete or replace it before publishing for real.
This post exists to exercise the rendering pipeline. It is safe to delete once you have written something real — nothing else references it.
Every post is an MDX file in content/posts. The filename becomes the URL, so
content/posts/formatting-reference.mdx is served at
/blog/formatting-reference/.
Frontmatter
Each file opens with a YAML block. title, description, and date are
required, and the build fails loudly if any is missing:
---
title: 'Post formatting reference'
description: 'One or two sentences. Used for meta tags, cards, and RSS.'
date: '2026-08-12'
tags: ['causal-inference', 'bayesian']
substackUrl: 'https://yourpub.substack.com/p/slug' # optional, added after syndicating
draft: true # optional, hides the post from builds, feeds, and sitemaps
---
Setting draft: true keeps a post visible in npm run dev while excluding it
from the production build, the RSS feed, and the sitemap. That is how you work
on something over several sessions without publishing it early.
Code
Fenced blocks are highlighted at build time, so no JavaScript ships to the browser for syntax colouring:
import jax.numpy as jnp
from jax import random
def bootstrap_filter(key, observations, n_particles=1_000):
"""Minimal bootstrap particle filter."""
particles = random.normal(key, (n_particles,))
log_weights = jnp.zeros(n_particles)
for y in observations:
particles = particles + random.normal(key, particles.shape)
log_weights += -0.5 * (y - particles) ** 2
return particles, jnp.exp(log_weights - jnp.max(log_weights))
Inline code such as getAllPosts() uses backticks.
Math
Math renders with KaTeX, also at build time. Inline math like sits in single dollar signs, and display math uses double:
Tables and quotes
| Method | Handles confounding | Needs an instrument |
|---|---|---|
| Randomised trial | Yes | No |
| Difference-in-diff | Under assumptions | No |
| Two-stage least sq | Yes | Yes |
Blockquotes are useful for pulling out a claim you intend to argue with.
Lists work as expected:
- Write the post here, in the repo.
- Deploy, so the canonical copy is indexed first.
- Syndicate to Substack a few days later.
That ordering is the whole point of the setup — see the README for why.