NOTES · · 1 MIN READ

Notes on a Zero-Friction Static Site Setup (Astro + Pagefind + GitHub Pages)

Architecture choices behind this rebuild: conditional KaTeX, language-scoped Pagefind search, and private-source to public-artifact publishing.

Notes on a Zero-Friction Static Site Setup (Astro + Pagefind + GitHub Pages)

When reviving a personal blog, the biggest risk is not choosing the wrong framework—it is creating maintenance overhead that makes you stop publishing.

Key Engineering Decisions

  • Zero external runtime CDNs: Fonts use a crisp system editorial stack and KaTeX stylesheets are vendored locally, avoiding the broken third-party CDN problem that hit the 2019 Hexo build.
  • Opt-in math rendering: Only posts with math: true activate inline/display LaTeX parsing (for example, E=mc2E = mc^2 or ∑i=1nxi\sum_{i=1}^{n} x_i), so shell snippets containing $HOME or $1 in legacy posts are never mangled.
  • Scoped search: Pagefind indexes the main English catalog (Essays and Notes) separately from the 2013–2019 Archive, preventing 70+ historical Chinese posts from drowning out new English essays.
  • Private source, public output: Drafts and editorial workflows stay in a private source repository; only audited static build artifacts are published to the public Pages branch.
# Create a new draft essay
pnpm run new essay "your-post-slug"

# Build static site + Pagefind index and run privacy/route checks
pnpm run build && pnpm run verify