The DIG Network documentation site — a Docusaurus v3
static site built with npm and deployed to S3 + CloudFront. It carries the
ecosystem's user-facing docs across 14 locales plus committed machine-readable
artifacts (llms.txt, knowledge-graph.json, openrpc.json, error-codes.json)
that other repositories consume.
The normative contract for the build pipeline, the machine artifacts, and the drift
gates is SPEC.md. Operational procedures (deploy + local run) live in
runbooks/.
- Node.js >= 18
- npm (the repo is npm-only —
package-lock.jsonis the lockfile; do not use yarn)
npm ci
npm start
Runs npm run gen first (generates knowledge-graph.json + the OpenRPC/error-code
artifacts), then starts the Docusaurus dev server with live reload.
npm run build
Generates the static site into dist/. onBrokenLinks/onBrokenAnchors are set to
throw, so a broken internal link or anchor in any locale fails the build. The
postbuild step annotates each locale's sitemap.xml with hreflang alternates.
npm run typecheck # tsc
npm run lint # eslint . — zero errors
npm run test:unit # node --test (pure logic + drift lints)
npm run test:a11y # Playwright: axe-core, ARIA tree, keyboard, mobile nav
npm run test:e2e # Playwright: full a11y/SEO suite (needs a build first)
When editing the documentation, be aware of these three pitfalls that fail the build or the test suite:
-
Install pages are mirrored across all 14 locales and must stay byte-identical. The four install pages under
docs/run-a-node/—index.md,universal-installer.md,apt.md,configure.md— are materialized as byte-identical English copies in everyi18n/<locale>/docusaurus-plugin-content-docs/current/run-a-node/tree, andtests/unit/install-path-lint.test.mjsfails the build if any mirror drifts. When you edit one of these four English pages, you MUST copy the change byte-for-byte into all 13 locale mirrors (same relative path under eachi18n/<locale>/…). -
A new English-only page needs site-absolute links. A docs page that has no per-locale translation is served as an English fallback in every locale. Its outgoing internal links must be site-absolute (
/docs/run-a-node/local-https), not relative (./local-https.md) — a relative link from an English-only fallback page, or a relative link to an English-only page from a physical locale mirror, fails the localized Docusaurus broken-link check (onBrokenLinks: 'throw'). -
Run
npm run test:unitlocally before opening or finishing a PR. The unit tests (includinginstall-path-lintand other drift lints) are separate fromnpm run build— the build alone will NOT catch install-page mirror drift or other linting failures. Always runnpm run test:unitlocally in addition tonpm run buildbefore pushing your changes.
Tag-triggered: pushing a v* tag runs .github/workflows/deploy.yml, which builds
and syncs dist/ to the S3 bucket docs-dig-net and invalidates CloudFront
distribution E1G7CFG1FDYG9Y. See runbooks/deploy.md.