Static site for alexandersumer.com. The Astro app lives in apps/blog, deploys to Cloudflare Pages, and ships with Pagefind search plus optional Giscus comments.
- Node.js 20+
- corepack enabled
pnpm@10.17.0(corepack installs it automatically)
corepack pnpm install
corepack pnpm --filter alexander-blog dev # http://localhost:4321corepack pnpm --filter alexander-blog dev– Astro dev server with HMR.corepack pnpm --filter alexander-blog build– Static build + Pagefind index inapps/blog/dist.corepack pnpm --filter alexander-blog test:unit– Vitest unit suite.corepack pnpm --filter alexander-blog test:e2e– Playwright smoke tests.corepack pnpm --filter alexander-blog test:functions– Bundles Cloudflare Pages Functions via Wrangler.corepack pnpm --filter alexander-blog lint– Runsastro check.
src/
features/
site/ # Layout shell, env-aware config helpers, OG middleware support
blog/ # Blog data access, computed metadata, Pagefind/Giscus UI glue
content/ # Astro content collections (blog posts + transforms)
pages/ # Astro routes
styles/ # Global CSS
functions/ # Cloudflare Pages Functions (OG image generation)
test/ # Vitest setup + unit suites + Astro env stubs
tests/ # Playwright end-to-end specs
- Public environment overrides come from
astro:env(seesrc/features/site/config). SetPUBLIC_SITE_URL,PUBLIC_ENABLE_PAGEFIND, and thePUBLIC_GISCUS_*keys to mirror production behaviour. Vitest maps this module totest/stubs/astro-env-client.tsso unit tests can stub values withprocess.env. - Blog frontmatter enriches each entry with display dates during
astro sync; the runtime layer (features/blog/api/posts.ts) attaches canonical URLs, reading time, and OG image metadata directly from collection entries. - Pagefind search and Giscus comments hydrate only when the relevant containers intersect the viewport, keeping the static HTML payload unchanged.
corepack pnpm --filter alexander-blog test:unit
corepack pnpm --filter alexander-blog test:e2e
corepack pnpm --filter alexander-blog test:functionsPlaywright starts Astro on 127.0.0.1:4321 and runs the Chromium project defined in playwright.config.ts.
Cloudflare Pages command:
corepack pnpm install --frozen-lockfile
corepack pnpm --filter alexander-blog build
Publish the apps/blog/dist directory and include apps/blog/functions for the OG image middleware. Pagefind assets are generated at dist/pagefind as part of the build.