This is an automated email from the ASF dual-hosted git repository.
moonming pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix-website.git
The following commit(s) were added to refs/heads/master by this push:
new 1f9b600a244 fix(ci): align zh learning-center deployment checks (#2089)
1f9b600a244 is described below
commit 1f9b600a244c4f7348ff93b7d727a6f6a15a3b3f
Author: Ming Wen <[email protected]>
AuthorDate: Thu Jul 30 13:51:24 2026 +0800
fix(ci): align zh learning-center deployment checks (#2089)
* fix(ci): align zh learning-center deployment checks
* test(ci): preserve zh subtree safeguards
---
.github/workflows/deploy.yml | 21 +++++++++++++++++----
.github/workflows/lint.yml | 12 ++++++++++++
next/scripts/generate-md-twins.mjs | 5 +++--
next/scripts/generate-sitemaps.test.mjs | 4 ++--
4 files changed, 34 insertions(+), 8 deletions(-)
diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml
index f1696a9d5f3..bf91cf8ca1d 100644
--- a/.github/workflows/deploy.yml
+++ b/.github/workflows/deploy.yml
@@ -247,9 +247,12 @@ jobs:
fail=0
for prefix in blog zh/blog learning-center zh/learning-center
articles zh/articles events zh/events; do
[ -d "website/build/$prefix" ] || continue
- missing=$(cd "website/build/$prefix" && find . -name index.html |
sort | while read -r f; do
- [ -f "$ROOT/next/dist/$prefix/$f" ] || echo "$prefix/$f"
- done)
+ missing=""
+ if [ "$prefix" != "zh/learning-center" ]; then
+ missing=$(cd "website/build/$prefix" && find . -name index.html
| sort | while read -r f; do
+ [ -f "$ROOT/next/dist/$prefix/$f" ] || echo "$prefix/$f"
+ done)
+ fi
if [ -n "$missing" ]; then
echo "MISSING in Astro build:"; echo "$missing"; fail=1
fi
@@ -267,6 +270,12 @@ jobs:
echo "NON-HTML files not in the Astro tree and not in the
feed-carry list:"; echo "$unhandled"; fail=1
fi
done
+ # zh/learning-center intentionally keeps only its localized landing
+ # page. Its English-only article, tag, archive, and pagination URLs
+ # redirect to the English tree instead of being rebuilt as duplicate
+ # pages, so exact Docusaurus parity does not apply to this subtree.
+ test -f next/dist/zh/learning-center/index.html
+ test "$(find next/dist/zh/learning-center -name index.html | wc -l)"
-eq 1
# Latest-version docs: Docusaurus no longer builds them (see
# onlyIncludeVersions in doc/docusaurus.config.js), so the reference
# is the LIVE SITE. Every version-less docs URL currently published
@@ -449,7 +458,11 @@ jobs:
run: |
node next/scripts/generate-sitemaps.mjs --dist website/build
grep -q
'<loc>https://apisix.apache.org/learning-center/mcp-protocol-ai-gateway/</loc>'
website/build/sitemap.xml
- grep -q
'<loc>https://apisix.apache.org/zh/learning-center/what-is-an-api-gateway/</loc>'
website/build/zh/sitemap.xml
+ grep -q '<loc>https://apisix.apache.org/zh/learning-center/</loc>'
website/build/zh/sitemap.xml
+ if grep -q
'<loc>https://apisix.apache.org/zh/learning-center/what-is-an-api-gateway/</loc>'
website/build/zh/sitemap.xml; then
+ echo 'Retired English-only Chinese learning-center URL remains in
the sitemap.'
+ exit 1
+ fi
if grep -Eq
'<loc>https://apisix\.apache\.org/(zh/)?(blog/(tags|page|archive)|learning-center/(tags|page|archive)|articles/(page|archive)|events/archive)/'
website/build/sitemap.xml website/build/zh/sitemap.xml; then
echo 'Low-value aggregation URLs remain in the final sitemap.'
exit 1
diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml
index 35174299020..f66b4084339 100644
--- a/.github/workflows/lint.yml
+++ b/.github/workflows/lint.yml
@@ -28,6 +28,18 @@ jobs:
- name: Build Astro site
working-directory: next
run: npm run build
+ - name: Assert Chinese learning-center retirement contract
+ working-directory: next
+ run: |
+ set -euo pipefail
+ node scripts/generate-md-twins.mjs
+ test -f dist/zh/learning-center/index.html
+ test "$(find dist/zh/learning-center -name index.html | wc -l)" -eq 1
+ test "$(find dist/zh/learning-center -name index.md | wc -l)" -eq 0
+ if grep -Eq
'https://apisix\.apache\.org/zh/learning-center/.+/index\.md' dist/llms.txt;
then
+ echo 'Retired Chinese learning-center Markdown URL remains in
llms.txt.'
+ exit 1
+ fi
- name: Test main pages on desktop and mobile
working-directory: next
run: npm run test:e2e
diff --git a/next/scripts/generate-md-twins.mjs
b/next/scripts/generate-md-twins.mjs
index 5eedba7a15d..3984d9000ba 100644
--- a/next/scripts/generate-md-twins.mjs
+++ b/next/scripts/generate-md-twins.mjs
@@ -31,7 +31,9 @@ const SITE = 'https://apisix.apache.org';
const COLLECTIONS = [
['blog-en', ['/blog']],
['blog-zh', ['/zh/blog']],
- ['learning-center', ['/learning-center', '/zh/learning-center']],
+ // Learning-center articles are English-only. The Chinese landing page links
+ // to these URLs directly; retired /zh/learning-center/<slug>/ pages
redirect.
+ ['learning-center', ['/learning-center']],
['articles', ['/articles', '/zh/articles']],
['docs-general', ['/docs/general', '/zh/docs/general']],
// The zh APISIX docs fall back to the English source where no translation
@@ -178,7 +180,6 @@ const llms = [
...section('Blog', group(en, '/blog/')),
...section('Articles', group(en, '/articles/')),
...section('中文文档', group(zh, '/docs/')),
- ...section('中文学习中心', group(zh, '/learning-center/')),
...section('中文博客', group(zh, '/blog/')),
...section('中文技术文章', group(zh, '/articles/')),
].join('\n');
diff --git a/next/scripts/generate-sitemaps.test.mjs
b/next/scripts/generate-sitemaps.test.mjs
index ec262bbeca8..8cf8937d9c5 100644
--- a/next/scripts/generate-sitemaps.test.mjs
+++ b/next/scripts/generate-sitemaps.test.mjs
@@ -42,7 +42,7 @@ const pages = [
'docs/apisix/upgrade-guide-from-2.15.x-to-3.0.0',
'search',
'zh',
- 'zh/learning-center/what-is-an-api-gateway',
+ 'zh/learning-center',
'zh/learning-center/tags/api-gateway',
'zh/articles/page/2',
'zh/events/archive',
@@ -94,7 +94,7 @@ try {
assert.match(en, /docs\/general\/blog\/page\/overview/);
assert.match(en, /docs\/apisix\/upgrade-guide-from-2\.15\.x-to-3\.0\.0/);
assert.match(en, /apisix-unity-group-q&a/);
- assert.match(zh, /zh\/learning-center\/what-is-an-api-gateway/);
+ assert.match(zh, /zh\/learning-center\/<\/loc>/);
assert.match(zh, /bi-weekly%20report/);
assert.ok(en.includes('<loc>https://apisix.apache.org/</loc><changefreq>weekly</changefreq><priority>1.0</priority>'));