Basic usage
Use the CLI to create your own Next.js + Doctocat site.
npx @primer/doctocat-nextjs@latest createFollow the prompts to choose the output directory and site title.
Prefer to create the Next.js app yourself? See how to install Doctocat using create-next-app.
Reference
| Command | Description |
|---|---|
create | Create a Doctocat site. |
build | Build a static export and route manifest. |
Create options
| Option | Description |
|---|---|
--target <directory> | Output directory. Prompted for interactively. |
--title <title> | Site title. Prompted for interactively. |
--base-path <path> | Optional root-relative URL prefix without a trailing slash. |
--static-export | Enable static export. Required for non-interactive creation. |
--package-manager npm | Use npm. Required for non-interactive creation. |
--repository-url <url> | Optional repository URL for source edit links. |
--repository-source-path <path> | Optional content path within the configured repository. |
--force | Write CLI scaffold files into a non-empty target. |
-h, --help | Show command help. |
Global options
| Option | Description |
|---|---|
-V, --version | Show the installed Doctocat version. |
-h, --help | Show CLI help. |
For non-interactive environments:
npx @primer/doctocat-nextjs@latest create \
--target ./docs-site \
--title "Documentation" \
--static-export \
--package-manager npmAuthor content
Put Markdown and MDX pages in content/. An index.mdx represents its directory route. Put static assets in public/ and reference them with root-relative paths.
Every page must have title and description frontmatter. Use menu-position to control navigation order. Customize the homepage in content/index.mdx and an imported component when needed.
After running the CLI
Run the following commands after creating your site with the CLI.
cd docs-site
npm ci
npm run dev
npm run check
npm run build