Build & Preview
A Nebari docs pack is a static Astro site. Building it produces a dist/
directory of HTML, CSS, JS, and a prebuilt Pagefind search index that you can host
anywhere.
-
Install dependencies (once):
Terminal window npm installTerminal window bun install -
Produce the production build:
Terminal window npm run buildTerminal window bun run build -
Preview the built site locally — this serves
dist/exactly as production will, including working search:Terminal window npm run previewTerminal window bun run preview
What the build produces
Section titled “What the build produces”Directorydist
- index.html
Directorygetting-started/
- …
Directoryguides/
- …
Directory_astro/ hashed CSS/JS and self-hosted fonts
- …
Directorypagefind/ prebuilt search index
- …
Building under a base path
Section titled “Building under a base path”If your pack is served from a subpath, build with the matching base so every
asset URL is prefixed. This site’s build:base script does exactly that:
{ "scripts": { "build:base": "astro build --base /demo-pack" }}astro build --base /my-packOnce the build and preview look right, continue to Deploy to Production.