Evidence
Recent commit: cb52e3017ab68b619fa1dd9cc69804a5a01ea8a4 / PR #1090 added scripts/sync-website-docs.sh and changed scripts/deploy-frontend.sh to call it.
The new script iterates source directories with a trailing slash:
for dirname in "$SOURCE_DOCS_DIR"/*/; do
...
cp -R "$dirname" "$WEBSITE_DOCS_DIR/"
done
In a local reproduction, that copied each documentation directory's contents into docs/website/docs/ instead of preserving category directories like docs/website/docs/guides/ and docs/website/docs/api/.
Reproduction
git checkout cb52e3017ab68b619fa1dd9cc69804a5a01ea8a4
cd docs/website
npm ci
cd ../..
./scripts/sync-website-docs.sh
find docs/website/docs -maxdepth 2 -type d | sort
cd docs/website
npm run build
Observed copied files were flattened at docs/website/docs/, for example docs/website/docs/0001-getting_started.md, with no docs/website/docs/guides/ directory.
The Docusaurus build then fails because docs/website/sidebars.ts still autogenerates sidebars from category directories:
[WARNING] No docs found in "guides": can't auto-generate a sidebar.
[ERROR] Sidebar category Guides has neither any subitem nor a link.
Expected
./scripts/sync-website-docs.sh should preserve the source directory names under docs/website/docs/, so guides, api, examples, etc. remain available to the Docusaurus autogenerated sidebars.
Minimal fix
Copy the directory path without the trailing slash, for example:
cp -R "$SOURCE_DOCS_DIR/$name" "$WEBSITE_DOCS_DIR/"
or strip the trailing slash before copying:
src="${dirname%/}"
cp -R "$src" "$WEBSITE_DOCS_DIR/"
I verified the minimal copy-path change preserves docs/website/docs/guides, docs/website/docs/api, etc., and npm run build then completes for both en and zh locales.
Evidence
Recent commit:
cb52e3017ab68b619fa1dd9cc69804a5a01ea8a4/ PR#1090addedscripts/sync-website-docs.shand changedscripts/deploy-frontend.shto call it.The new script iterates source directories with a trailing slash:
In a local reproduction, that copied each documentation directory's contents into
docs/website/docs/instead of preserving category directories likedocs/website/docs/guides/anddocs/website/docs/api/.Reproduction
Observed copied files were flattened at
docs/website/docs/, for exampledocs/website/docs/0001-getting_started.md, with nodocs/website/docs/guides/directory.The Docusaurus build then fails because
docs/website/sidebars.tsstill autogenerates sidebars from category directories:Expected
./scripts/sync-website-docs.shshould preserve the source directory names underdocs/website/docs/, soguides,api,examples, etc. remain available to the Docusaurus autogenerated sidebars.Minimal fix
Copy the directory path without the trailing slash, for example:
or strip the trailing slash before copying:
I verified the minimal copy-path change preserves
docs/website/docs/guides,docs/website/docs/api, etc., andnpm run buildthen completes for bothenandzhlocales.