From e7099f3d6af81da392c9350350eebf19ae17a2f0 Mon Sep 17 00:00:00 2001 From: neil Date: Thu, 10 Jul 2025 15:22:38 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=88=A0=E9=99=A4=E6=97=A0=E7=94=A8?= =?UTF-8?q?=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 4 ++- docusaurus.config.ts | 63 +------------------------------------------- 2 files changed, 4 insertions(+), 63 deletions(-) diff --git a/.gitignore b/.gitignore index 62c5e57..92bfaf4 100644 --- a/.gitignore +++ b/.gitignore @@ -23,4 +23,6 @@ yarn-error.log* .vscode # local env files -.env \ No newline at end of file +.env + +/static/test.yml \ No newline at end of file diff --git a/docusaurus.config.ts b/docusaurus.config.ts index e846efb..0686e93 100644 --- a/docusaurus.config.ts +++ b/docusaurus.config.ts @@ -264,6 +264,7 @@ const config: Config = { showNavLink: false, configuration: { url: `${SITE_URL}/v1/yaml`, + // url: `/docs/test.yml`, // 本地测试 hideModels: true, servers: [ { @@ -277,68 +278,6 @@ const config: Config = { cdn: '/docs/@scalar/api-reference@1.32.5.js', } as ScalarOptions, ], - [ - '@scalar/docusaurus', - { - id: 'openapi/serverless', - label: '', - route: '/docs/openapi/serverless', - cdn: '/docs/@scalar/api-reference@1.32.5.js', - showNavLink: false, - configuration: { - url: `${SITE_URL}/api/serverless/yaml`, - hideModels: true, - servers: [ - { - url: `${SITE_URL}/api/serverless`, - description: '生产服务器', - }, - ], - defaultOpenAllTags: true, - }, - } as ScalarOptions, - ], - [ - 'docusaurus-plugin-remote-content', - { - name: 'gai-readme', - sourceBaseUrl: 'https://gitee.com/gitee-ai-opensource/cli/raw/master/', - outDir: 'docs/gai', - documents: ['README.md'], - modifyContent: (filename, content) => { - if (filename === 'README.md') { - let lines = content.split('\n'); - - // 修改标题 - const titleIndex = lines.findIndex((line) => - line.trim().includes('# Gitee AI 命令行工具'), - ); - if (titleIndex !== -1) { - lines[titleIndex] = '# 使用 Gitee AI 命令行工具上传模型'; - } - - // update img link - lines = lines.map((line) => - line.includes('png') - ? line.replace('assets/', '../../static/img/gai/') - : line, - ); - - // 参与贡献之后的行都不要 - const idx = lines.findIndex((line) => line.includes('参与贡献')); - if (idx !== -1) { - lines = lines.slice(0, idx); - } - - return { - filename: 'gai.md', - content: lines.join('\n'), - }; - } - return undefined; - }, - }, - ], function () { return { name: 'cdn-image-plugin', -- Gitee