Building the Antora Documentation Site Locally
This guide explains how to build the Antora documentation site locally for development and testing purposes.
Prerequisites
-
Node.js (LTS version recommended)
-
pnpm package manager
-
All component repositories cloned locally in the parent directory
Quick Start
-
Open a shell at the root of your clone of the
docsrepository (the folder that containsantora-playbook.ymlandpackage.json):cd path/to/docs -
Install dependencies:
pnpm install -
Build the site locally:
pnpm exec antora antora-playbook-local.ymlOr build from GitHub sources (standard playbook):
pnpm exec antora antora-playbook.yml -
Preview the site:
The site is generated in
build/site/. You can:-
Open
build/site/index.htmldirectly in your browser -
Or use a local server:
pnpm dlx http-server build/site -c-1 -p 8080
-
Playbook Files
The documentation repository contains two Antora playbook files:
antora-playbook.yml (GitHub URLs)
This is the standard Antora playbook that uses GitHub URLs, following Antora’s conventional naming:
content:
sources:
- url: {github-org-url}/example-component.git
branches: HEAD
start_path: docs
# ... other sources
Use this for: * CI/CD builds * Production deployments * When you want to build from the latest published content on GitHub * Following Antora’s standard tutorial conventions
Limitations: * Requires network access to clone repositories * Slower builds (clones repositories) * May not work if local repository remotes don’t match the GitHub URLs
antora-playbook-local.yml (Local Paths)
This is the local development playbook that uses local filesystem paths:
content:
sources:
- url: ../example-component
branches: HEAD
start_path: docs
# ... other sources
Use this for: * Local development and testing * Faster builds (no cloning needed) * Working with uncommitted changes
Advantages: * Faster builds (uses local files directly) * Works offline * Reflects your current working directory state * Better for iterative development
Why Two Playbooks?
The two playbook files serve different purposes:
-
Standard Convention: The
antora-playbook.ymlfollows Antora’s standard naming convention and uses GitHub URLs, matching Antora tutorials and CI/CD workflows. -
Local Development: The
antora-playbook-local.ymluses local paths for faster iteration and testing of documentation changes without needing to commit and push to GitHub. -
Repository Structure: Some local repositories may have different remote URLs than what’s specified in the GitHub playbook. The local playbook works around this by using filesystem paths.
Building with GitHub URLs
|
For GitHub URLs to work locally, your local repositories must have matching remote URLs. If they don’t match, Antora will attempt to clone from GitHub, which requires network access. |
To build using GitHub URLs (standard playbook):
pnpm exec antora antora-playbook.yml
This will: * Clone repositories from GitHub if they don’t exist locally * Use local git repositories if they match the remote URL * Fail if repositories don’t exist locally and network access is unavailable
The antora-playbook.yml file follows Antora’s standard naming convention used in official tutorials.
|
Troubleshooting
Missing antora.yml in Components
If you see an error like antora.yml not found, ensure each component repository has an antora.yml file in its docs/ directory.
File Structure
The build process creates the following structure:
docs/ # Repository root (clone of FoodTruckNerdz/docs)
├── antora-playbook.yml # Standard playbook (GitHub URLs)
├── antora-playbook-local.yml # Local paths (git-ignored; copy from .example)
├── package.json # Antora dependencies, `pnpm run build`
├── pnpm-lock.yaml
├── build/ # Created by Antora
│ └── site/ # Generated site output
│ ├── index.html
│ ├── onboarding/
│ ├── food-truck-api/
│ └── ...
├── site/ # UI sync + supplemental (not the playbooks)
│ ├── scripts/ # e.g. sync-antora-dark-theme.cjs
│ └── supplemental-ui/ # Custom UI overrides
├── docs/ # *Component* for this repository (`start_path: docs` in playbook)
│ ├── antora.yml
│ └── modules/
├── ftn-docs.code-workspace
├── .vscode/
└── README.adoc