Skip to content

Commit 8b4ca2e

Browse files
morningmanclaude
andauthored
[fix] revert per-locale split build and drop legacy dev docs (#3616)
Restore the single bilingual `docusaurus build --locale en --locale zh-CN` invocation in the cron and manual deploy workflows; the prior per-locale split produced different webpack content hashes for EN and ZH, leaving zh-CN HTML referencing /assets/styles.<zh-hash>.css that only existed under build/zh-CN/ and 404'd under root. Disable building the unversioned (dev) tree of the legacy docs plugin — the dev version now lives under the docs-next plugin only — by removing "current" from versions.json and setting includeCurrentVersion: false on the classic preset's docs config. --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 7b8ad91 commit 8b4ca2e

6 files changed

Lines changed: 28 additions & 28 deletions

File tree

.github/workflows/build-check.yml

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -86,18 +86,22 @@ jobs:
8686
# Check each changed file and map to doc version
8787
while IFS= read -r file; do
8888
case "$file" in
89-
# English current (dev) docs
89+
# English legacy current dir — no longer compiled
90+
# (dev moved to docs-next plugin). PR #3610 forbids
91+
# modifying these files; if they change anyway, fall
92+
# through to a minimal default-version smoke build.
9093
docs/*)
91-
VERSIONS="current,$VERSIONS"
94+
VERSIONS="4.x,$VERSIONS"
9295
;;
9396
# English versioned docs
9497
versioned_docs/version-*/*)
9598
ver=$(echo "$file" | sed -n 's|versioned_docs/version-\([^/]*\)/.*|\1|p')
9699
VERSIONS="${ver},$VERSIONS"
97100
;;
98-
# Chinese current docs
101+
# Chinese legacy current dir — no longer compiled
102+
# (see docs/* note above).
99103
i18n/zh-CN/docusaurus-plugin-content-docs/current/*)
100-
VERSIONS="current,$VERSIONS"
104+
VERSIONS="4.x,$VERSIONS"
101105
LOCALES="en,zh-CN"
102106
;;
103107
# Chinese versioned docs
@@ -110,9 +114,11 @@ jobs:
110114
i18n/zh-CN/docusaurus-plugin-content-docs-community/*|i18n/zh-CN/code.json)
111115
LOCALES="en,zh-CN"
112116
;;
113-
# Sidebar for current (dev) version
117+
# Sidebar for legacy current — no longer compiled
118+
# (legacy plugin uses includeCurrentVersion: false).
119+
# Fall through to minimal default-version build.
114120
sidebars.ts)
115-
VERSIONS="current,$VERSIONS"
121+
VERSIONS="4.x,$VERSIONS"
116122
;;
117123
# Versioned sidebars: extract version from filename
118124
# e.g. versioned_sidebars/version-4.x-sidebars.json → 4.x
@@ -158,9 +164,10 @@ jobs:
158164
# No versioned doc changes (e.g., only blog, community, or scripts).
159165
# Blog and community plugins are always compiled by Docusaurus
160166
# regardless of DOCS_VERSIONS, so we just set the minimal docs
161-
# scope to keep the build fast.
162-
DOCS_VERSIONS="current"
163-
echo "No doc version changes detected, doing minimal build with 'current' only."
167+
# scope to keep the build fast. Use the default version since
168+
# the legacy plugin no longer ships an unversioned 'current'.
169+
DOCS_VERSIONS="4.x"
170+
echo "No doc version changes detected, doing minimal build with '4.x' only."
164171
echo "(Blog and community plugins are always built regardless.)"
165172
fi
166173

.github/workflows/cron-deploy-website.yml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,7 @@ jobs:
3939
export NODE_OPTIONS=--max-old-space-size=8192
4040
yarn
4141
node ./scripts/update_github_info.js
42-
# Build each locale separately into its own out-dir to halve per-process peak memory and avoid OOM on the GitHub-hosted runner.
43-
PWA_SERVICE_WORKER_URL=https://doris.apache.org/sw.js yarn docusaurus build --locale en --out-dir build-en
44-
PWA_SERVICE_WORKER_URL=https://doris.apache.org/sw.js yarn docusaurus build --locale zh-CN --out-dir build-zh
45-
rm -rf ./build && mkdir ./build
46-
cp -a ./build-en/. ./build/
47-
# docusaurus build --locale zh-CN --out-dir build-zh writes the locale's full output directly under build-zh/ (no zh-CN subdir); the emitted HTML already contains /zh-CN/ URL prefixes, so we publish build-zh/ verbatim under build/zh-CN/.
48-
mkdir -p ./build/zh-CN
49-
cp -a ./build-zh/. ./build/zh-CN/
42+
PWA_SERVICE_WORKER_URL=https://doris.apache.org/sw.js yarn docusaurus build --locale en --locale zh-CN
5043
if [ ! -d "./ja-build" ]; then
5144
echo "ja-build directory not found, aborting to avoid publishing incorrect ja content."
5245
exit 1

.github/workflows/docs-next-build.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,14 @@ jobs:
6565
npm install -g yarn
6666
yarn install --frozen-lockfile || yarn install
6767
68-
- name: Build (current only, EN + zh-CN)
68+
- name: Build (docs-next + minimal legacy 4.x, EN + zh-CN)
6969
if: steps.changes.outputs.relevant == 'true'
7070
env:
71-
DOCS_VERSIONS: current
71+
# Keep the legacy docs plugin enabled (needed by docsVersionDropdown
72+
# navbar items on /archive-docs, /community/..., etc.) but limit it
73+
# to a single version to keep the smoke build fast. 'current' is no
74+
# longer a valid legacy version — that build moved to docs-next.
75+
DOCS_VERSIONS: '4.x'
7276
run: |
7377
export NODE_OPTIONS=--max-old-space-size=8192
7478
yarn docusaurus build --locale en --locale zh-CN

.github/workflows/manual-deploy-website.yml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,7 @@ jobs:
4242
yarn cache clean
4343
export NODE_OPTIONS=--max-old-space-size=8192
4444
yarn
45-
# Build each locale separately into its own out-dir to halve per-process peak memory and avoid OOM on the GitHub-hosted runner.
46-
PWA_SERVICE_WORKER_URL=https://doris.apache.org/sw.js yarn docusaurus build --locale en --out-dir build-en
47-
PWA_SERVICE_WORKER_URL=https://doris.apache.org/sw.js yarn docusaurus build --locale zh-CN --out-dir build-zh
48-
rm -rf ./build && mkdir ./build
49-
cp -a ./build-en/. ./build/
50-
# docusaurus build --locale zh-CN --out-dir build-zh writes the locale's full output directly under build-zh/ (no zh-CN subdir); the emitted HTML already contains /zh-CN/ URL prefixes, so we publish build-zh/ verbatim under build/zh-CN/.
51-
mkdir -p ./build/zh-CN
52-
cp -a ./build-zh/. ./build/zh-CN/
45+
PWA_SERVICE_WORKER_URL=https://doris.apache.org/sw.js yarn docusaurus build --locale en --locale zh-CN
5346
if [ ! -d "./ja-build" ]; then
5447
echo "ja-build directory not found, aborting to avoid publishing incorrect ja content."
5548
exit 1

docusaurus.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,9 @@ const config = {
262262
/** @type {import('@docusaurus/preset-classic').Options} */
263263
({
264264
docs: SKIP_DOCS ? false : {
265+
// Dev (unversioned) build moved to the docs-next plugin; the legacy
266+
// docs/ tree only ships the snapshotted versions in versions.json.
267+
includeCurrentVersion: false,
265268
...(ONLY_VERSIONS && { onlyIncludeVersions: ONLY_VERSIONS }),
266269
// When filtering versions, lastVersion must be in the
267270
// included list. Fall back to the first included version.

versions.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
["4.x", "3.x", "2.1", "current"]
1+
["4.x", "3.x", "2.1"]

0 commit comments

Comments
 (0)