diff --git a/.gitignore b/.gitignore index 62c5e57c043d0e19527244da813cf2cead47dde9..92bfaf4897bbab3db5f02d467cdc6dc9cdce3193 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 e846efbaea6a2ab0b2618fd23c44d8af1d3860da..0686e938ff50392f1de4eb3bd4adc636c98ed1eb 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',