* docs: serve v2 documentation from v2.docs.nocobase.com * docs: read the site origin from DOCS_SITE_ORIGIN and rewrite legacy docs links - Read the site origin from DOCS_SITE_ORIGIN (default https://v2.docs.nocobase.com). - Docs assistant accepts citations on the site host and on docs.nocobase.com. - Rewrite absolute docs.nocobase.com links in content to the site origin at build time. - Emit robots.txt with the sitemap location next to sitemap.xml. - gen_rag.sh derives its domains from DOCS_SITE_ORIGIN.
NocoBase Documentation
--lang
yarn docs dev --lang=en
yarn docs build --lang=en
yarn docs preview --lang=en
yarn docs build --lang=all
--check-dead-links
yarn docs build --lang=en --check-dead-links
DOCS_SITE_ORIGIN
The site's public origin defaults to https://v2.docs.nocobase.com. It is used for canonical links, hreflang alternates, sitemap.xml, robots.txt, JSON-LD and the documentation assistant. Set DOCS_SITE_ORIGIN at build time to serve the site from another origin:
DOCS_SITE_ORIGIN=https://example.com yarn docs build --lang=en
Absolute links to https://docs.nocobase.com/... in the markdown content are rewritten to this origin at build time (plugins/pluginSiteOriginLinks.ts), so the content itself does not need to change.
Documentation AI assistant
The documentation assistant calls an independent Rust backend from the docs-ai-service repository. The backend searches and verifies live pages of the documentation site. The assistant accepts citations on the configured site host (DOCS_SITE_ORIGIN) and on the legacy docs.nocobase.com host, and links legacy citations on the configured site origin. The documentation build does not generate a local AI index.
For local Chinese development, start the backend, then restart Rspress with the backend URL defined at build time:
Set-Location <path-to-docs-ai-service>
cargo run
Set-Location <path-to-nocobase>
$env:DOCS_AI_API_URL = 'http://127.0.0.1:3100'
corepack yarn --cwd docs dev --lang=cn
Configure the backend for the approved DeepSeek online search provider before starting it. The UI always displays server-provided official citations and renders answer text without raw HTML.
eject rspress components
Customize the theme by ejecting the components. After ejecting, you can find the components in ./src/components and modify them as you like.
yarn eject <ComponentName>
demo preview
use @docs/* to import the demo components, which will be replaced with the actual path during build.
import { HelloModel } from '@docs/cn/flow-engine/_demos/HelloModel';
Then use the demo component in the markdown file:
```tsx file="./_demos/flow-model-renderer.tsx" preview
```