diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index dd5acd1..bf3e5b5 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -43,12 +43,23 @@ for prior user-research context on content organisation. ## Building locally +This repository requires the Node.js version specified in the +[`.nvmrc` file](.nvmrc). Install the dependencies and generate the static site: + ```bash npm install npm run build -# Output is written to out/ ``` +The output is written to `out/`. Start a local server from a separate terminal: + +```bash +npx serve out +``` + +Open to preview the site. Run `npm run build` +again after making changes to update the generated output. + ## Code of Conduct This project follows the diff --git a/README.md b/README.md index ec19120..e1792f6 100644 --- a/README.md +++ b/README.md @@ -30,13 +30,6 @@ The structure is based on [Card Sort research](https://github.com/nodejs/nodejs.org/issues/8234) conducted at the 2025 Cambridge Node.js Collaborators' Summit. -## Development - -```bash -npm install -npm run build # generates static site + Orama search DB in out/ -``` - ## Contributing See [CONTRIBUTING.md](CONTRIBUTING.md). diff --git a/doc-kit.config.mjs b/doc-kit.config.mjs index 676adc5..06fd267 100644 --- a/doc-kit.config.mjs +++ b/doc-kit.config.mjs @@ -2,14 +2,18 @@ import web from '@node-core/doc-kit/src/generators/web/index.mjs'; import { join } from 'node:path'; const origin = - process.env.VERCEL_ENV === 'preview' ? process.env.VERCEL_URL : 'nodejs.org'; + process.env.VERCEL_ENV === 'preview' + ? `https://${process.env.VERCEL_URL}` + : process.env.VERCEL_ENV === 'production' + ? 'https://nodejs.org' + : 'http://localhost:3000'; /** @type {import('@node-core/doc-kit/src/utils/configuration/types.d.ts').Configuration} */ export default { global: { output: 'out/learn', input: ['pages/**/*.md'], - baseURL: `https://${origin}/learn`, + baseURL: `${origin}/learn`, }, 'jsx-ast': { generateIndexPage: false,