Skip to Content
StackThis documentation site

This documentation site

docs-site/ is a standalone Next.js app with its own package.json, lockfile and Vercel project, deployed at docs.antmejia.com . It shares no code with the portfolio.

Dependencies

PackageWhat it does here
nextra, nextra-theme-docsThe docs framework and theme. Pages are MDX files in content/, and sidebar order and titles come from _meta.js files
next, react, react-domThe same versions as the portfolio. Builds with Turbopack, since the docs site has no webpack config
pagefindBuilds the search index from the exported HTML in out/ after next build (postbuild, scripts/postbuild.mjs). Search runs in the browser against that index; there is no search service
playwrightBrowser tests for search, pnpm test:search, including visual snapshots
axe-coreAutomated accessibility checks inside those browser tests
typescript, @types/node, @types/reactTypes for the components in components/ and the config in app/

zod is not a direct dependency. Nextra needs it, and pnpm.overrides pins it to 4.1.12 because Nextra 4.6 breaks on newer versions. Renovate is told to leave that pin alone.

How content is built

  • Pages. content/*.mdx and the content/stack/ section are written by hand.
  • Reference. scripts/sync-reference-docs.mjs copies the repository’s docs/*.md guides into content/reference/ before every dev and build (predev, prebuild). The folder is generated and gitignored, so edit the files in docs/. Guides are compiled as plain Markdown, so a { or < in one cannot break the build.
  • Search. pnpm build ends by indexing the rendered HTML with Pagefind. Rebuild after changing content to refresh search. See Documentation search.
  • Fonts. Atomic Serif for headings, loaded from the portfolio’s own font file, Google Sans for body text and Saira for display text, through next/font.

Tests

pnpm test runs the Node tests in scripts/*.test.mjs: the reference sync, the search URL helpers, the crawl policy and the Vercel ignore script. pnpm test:search needs a production build and a Chromium install, and is covered in Documentation search.

Deploying

The docs project builds from the production branch only, and only when docs-site/, docs/ or src/assets/fonts/ changed since the last deployed commit (scripts/vercel-ignore.sh). The fonts count because the docs layout loads the portfolio’s Atomic Serif file. A pull request that touches either runs the docs build and the search tests in CI. Setting DOCS_BASE_PATH mounts the site under a path such as /docs; it must start with / and have no trailing slash.

The site is a static export (output: "export" in next.config.mjs), and vercel.json sets framework: null, outputDirectory: "out" and cleanUrls: true, so Vercel serves out/ as plain static files. This is deliberate. For Next 16, Vercel’s build adapter moves prerendered pages out of .next/server/app and copies the output before postbuild runs, so indexing .next found no HTML (v1.6.0, Found 0 files matching **/*.{html}) and an index written afterwards never reached the deployment. pnpm start runs scripts/serve-out.mjs, which serves out/ the way Vercel does, because next start cannot serve an export.

Last updated on