Deployment
This documentation site is deployed under the /lhui/core/ prefix of www.lhgb.top per the family convention (same scheme as the android / ios / harmony / windows sites).
The site framework is Astro Starlight (migrated from VitePress on 2026-10-12; for the rationale see Docs Site Tech Stack).
pnpm docs:buildThe output lands in docs/dist/ (astro.config.mjs sets outDir: 'docs/dist' explicitly — this deliberately avoids the repository-root dist/ used by codegen, see red line 6; it is listed in .gitignore and never committed).
All deployment-related configuration lives in docs/astro.config.mjs:
| Option | Value | Purpose |
|---|---|---|
site |
https://www.lhgb.top |
Site origin for sitemap and SEO |
base |
/lhui/core/ |
Deployment prefix; must start and end with a slash |
build.format |
'file' |
Emits page.html instead of page/index.html, aligning with the family nginx contract |
trailingSlash |
'never' |
Managed by Starlight, in combination with format: 'file' |
Uploading
Section titled “Uploading”Upload the contents of docs/dist/ to the server directory /home/webuser/nginx/lh-ui/core/.
nginx configuration
Section titled “nginx configuration”location ^~ /lhui/core/ { alias /home/webuser/nginx/lh-ui/core/; index index.html; try_files $uri $uri.html $uri/ /lhui/core/index.html;}Three family hard-won rules (each re-confirmed after the Starlight migration):
- The
try_filesfallback must include the base prefix (/lhui/core/index.html), otherwise deep-link refreshes return 404. - The trailing slash of
aliasis mandatory, and it pairs withlocation ^~ /lhui/core/. $uri.htmlis required — this site’sbuild.format: 'file'producespage.htmlfiles (URLs like/lhui/core/page, no trailing slash), and nginx relies on$uri.htmlto fall back to the real file; dropping it breaks deep links with 404.
Post-deployment self-check
Section titled “Post-deployment self-check”curl -I https://www.lhgb.top/lhui/core/guide/introductiongrep -c "lhui/core" docs/dist/index.html # expect > 0# reverse assertion: the output must not contain site-internal links missing the base (hit count should be 0)grep -rcE 'href="/(guide|tokens|specs|cases|codegen|artifacts)/' docs/dist/ | grep -v ':0$' || echo OKLocal preview
Section titled “Local preview”pnpm docs:dev # http://localhost:5185/lhui/core/pnpm docs:preview # preview the production build, also with the base prefixAstro’s base applies to the dev server too (unlike VitePress, which relied on .env.development to set DOCS_BASE=/), so local URLs also carry the /lhui/core/ prefix — local and production URL structures are identical, removing the old “no prefix locally, prefix in production” mental overhead.
Port allocation
Section titled “Port allocation”| Repository | dev port | base |
|---|---|---|
| lh-ui-vue2 | 5177 | /lhui/vue2/ |
| lh-ui-plus | 5178 | /lhui/vue3/ |
| lh-ui-react | 5179 | /lhui/react/ |
| lh-ui-uniapp | 5187 | /lhui/uniapp/ |
| lh-ui-android | 5181 | /lhui/android/ |
| lh-ui-ios | 5182 | /lhui/ios/ |
| lh-ui-harmony | 5183 | /lhui/harmony/ |
| lh-ui-windows | 5186 | /lhui/windows/ |
| lh-ui-core (this site) | 5185 | /lhui/core/ |
The authoritative reference for family deployment is 部署/nginx-lhui.conf.md in the lh-ui/docs repository; this page is this repo’s own copy of the operations manual. After a deployment goes live, the family overview table should be updated accordingly (this change involves no cross-repository edits).
Copyright © 2024-2026 FengMo WenXue