Skip to content

docs-site/docs-site-commands

The docs:build, docs:dev and docs:preview commands of a documentation site.

Each takes the same DocsSiteConfig the site’s astro.config.ts passes to defineDocsSiteConfig, so a repository describes its site once, in a module both import.

Function Description
buildDocsSite Builds the site: generates the API reference and the Open Graph cards, runs astro build, then checks every link of the output. With DocsSiteConfig.repoHomepage on, it then checks the repository’s GitHub homepage against the site’s URL.
devDocsSite Generates the API reference, then serves the site with astro dev until it is stopped.
previewDocsSite Serves the last build with astro preview until it is stopped.