This post lives in Notion. The Jekyll site you’re reading it on never saw the source — a sync script pulled it through the Notion API and wrote a markdown file to _posts/.

Why

Two reasons. Jekyll’s bilingual + frontmatter + math dance is fiddly to write by hand, and Notion’s editor is just nicer for drafting.

How it works

A Python script reads the Blog Posts database, picks rows where Status = Published, fetches each page’s blocks, converts them to markdown, and writes _posts/{date}-{slug}.md.

  • Titletitle
  • Publish Datedate
  • Categoriescategories
  • Last Editedlast_updated

Math

Equation blocks become display math. The KL3 estimator from Schulman’s blog:

\[K_3 = (r - 1) - \log r, \quad r = \frac{\pi_{\text{ref}}(x)}{\pi(x)}\]

Inline equations like \(\mathbb{E}_{x \sim \pi}[K_3] = \mathrm{KL}(\pi \,\|\, \pi_{\text{ref}})\) also pass through.

Code

def slugify(s):
    return re.sub(r'[^\w]+', '-', s.lower()).strip('-')

Next

Wire a GitHub Action so this runs on a cron and commits the result automatically. Until then, uv run python bin/sync_notion.py by hand.