From 475bafbb151f34d97ca38b1bddff6cb2ec8b727e Mon Sep 17 00:00:00 2001
From: xiayu
Date: Fri, 3 Jul 2026 22:58:58 +0800
Subject: [PATCH] =?UTF-8?q?docs:=20=E4=BF=AE=20Fumadocs=20githubUrl=20?=
=?UTF-8?q?=E5=8F=8Cmdx=20+=20markdownUrl=20basePath=20+=20README=20?=
=?UTF-8?q?=E5=9B=BE=E7=89=87=E7=BB=9D=E5=AF=B9URL?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
1. page.tsx githubUrl: 去掉 .mdx 后缀(page.path 已含扩展名,之前拼成 index.mdx.mdx)
2. source.ts getPageMarkdownUrl: 用 assetPath 包裹加 basePath(GitHub Pages 在
/ksadk-python 子路径,复制 markdown URL 不带 basePath 导致 404)
3. README 4 张图改用绝对 raw URL 指向 docs-site/public/assets/(public-docs/
已不在 main,相对链接 404)
Co-Authored-By: Claude Opus 4.8
---
README.md | 8 ++++----
docs-site/app/[lang]/docs/[[...slug]]/page.tsx | 2 +-
docs-site/lib/source.ts | 5 +++--
tests/test_public_release_positioning.py | 16 ++++++++--------
4 files changed, 16 insertions(+), 15 deletions(-)
diff --git a/README.md b/README.md
index 926c6d65..f4baf508 100644
--- a/README.md
+++ b/README.md
@@ -16,7 +16,7 @@
-
+
## 30 秒快速体验
@@ -37,9 +37,9 @@ agentengine run -i
agentengine web . --no-open
```
-
+
-
+
## 为什么需要 KsADK
@@ -53,7 +53,7 @@ agentengine web . --no-open
## 架构
-
+
## 文档与样例
diff --git a/docs-site/app/[lang]/docs/[[...slug]]/page.tsx b/docs-site/app/[lang]/docs/[[...slug]]/page.tsx
index 982c1746..3066b103 100644
--- a/docs-site/app/[lang]/docs/[[...slug]]/page.tsx
+++ b/docs-site/app/[lang]/docs/[[...slug]]/page.tsx
@@ -36,7 +36,7 @@ export default async function Page({
diff --git a/docs-site/lib/source.ts b/docs-site/lib/source.ts
index 94e65a32..45eb464b 100644
--- a/docs-site/lib/source.ts
+++ b/docs-site/lib/source.ts
@@ -4,7 +4,7 @@ import { docs } from 'collections/server';
import { loader } from 'fumadocs-core/source';
import { statusBadgesPlugin } from 'fumadocs-core/source/plugins/status-badges';
import { i18n } from './i18n';
-import { docsContentRoute, docsImageRoute, docsRoute } from './shared';
+import { docsContentRoute, docsImageRoute, docsRoute, assetPath } from './shared';
// See https://fumadocs.dev/docs/headless/source-api for more info
export const source = loader({
@@ -47,7 +47,8 @@ export function getPageMarkdownUrl(page: (typeof source)['$inferPage']) {
return {
segments,
- url: `${docsContentRoute}/${segments.join('/')}`,
+ // GitHub Pages 在 / 子路径,markdown URL 需带 basePath,否则复制出来 404。
+ url: assetPath(`${docsContentRoute}/${segments.join('/')}`),
};
}
diff --git a/tests/test_public_release_positioning.py b/tests/test_public_release_positioning.py
index 3550728b..0425339b 100644
--- a/tests/test_public_release_positioning.py
+++ b/tests/test_public_release_positioning.py
@@ -26,10 +26,10 @@ def test_public_readme_positions_ksadk_as_runtime_platform():
"文档与样例",
"相关项目",
"参与贡献",
- "public-docs/assets/ksadk-runtime-platform-hero-wide.png",
- "public-docs/assets/ksadk-web-ui-screenshot.png",
- "public-docs/assets/ksadk-local-debugging-demo.gif",
- "public-docs/assets/ksadk-runtime-architecture.png",
+ "ksadk-runtime-platform-hero-wide.png",
+ "ksadk-web-ui-screenshot.png",
+ "ksadk-local-debugging-demo.gif",
+ "ksadk-runtime-architecture.png",
):
assert expected in readme
@@ -46,10 +46,10 @@ def test_public_readme_language_variants_keep_homepage_shape():
for text in (zh_readme, en_readme):
assert "Kingsoft Cloud Agent Development Kit" in text
- assert "public-docs/assets/ksadk-runtime-platform-hero-wide.png" in text
- assert "public-docs/assets/ksadk-web-ui-screenshot.png" in text
- assert "public-docs/assets/ksadk-local-debugging-demo.gif" in text
- assert "public-docs/assets/ksadk-runtime-architecture.png" in text
+ assert "ksadk-runtime-platform-hero-wide.png" in text
+ assert "ksadk-web-ui-screenshot.png" in text
+ assert "ksadk-local-debugging-demo.gif" in text
+ assert "ksadk-runtime-architecture.png" in text
assert "发布版本:" not in text
assert "## 0.6." not in text