19 Star 8 Fork 1

Gitee AI 开源/Gitee AI 文档

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
docusaurus.config.ts 10.21 KB
一键复制 编辑 原始数据 按行查看 历史
林莹雪 提交于 2025-05-16 14:29 +08:00 . !64默认展开左侧栏的层级,API 文档
import 'dotenv/config';
import { themes as prismThemes } from 'prism-react-renderer';
import type { Config } from '@docusaurus/types';
import type * as Preset from '@docusaurus/preset-classic';
import type { ScalarOptions } from '@scalar/docusaurus';
const CDN_PREFIX = process.env.DOCS_CDN_PREFIX;
const config: Config = {
title: '模力方舟(Gitee AI)',
tagline: '开发 AI 应用从此简单',
favicon: `${CDN_PREFIX}/img/favicon.ico`,
// Set the production url of your site here
url: 'https://ai.gitee.com',
// Set the /<baseUrl>/ pathname under which your site is served
// For GitHub pages deployment, it is often '/<projectName>/'
baseUrl: '/docs/',
// GitHub pages deployment config.
// If you aren't using GitHub pages, you don't need these.
organizationName: 'gitee-ai', // Usually your GitHub org/user name.
projectName: 'docs', // Usually your repo name.
onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'warn',
// Even if you don't use internationalization, you can use this field to set
// useful metadata like html lang. For example, if your site is Chinese, you
// may want to replace "en" with "zh-Hans".
i18n: {
defaultLocale: 'zh-Hans',
locales: ['zh-Hans'],
},
presets: [
[
'classic',
{
docs: {
routeBasePath: '/',
sidebarPath: './sidebars.ts',
// Please change this to your repo.
// Remove this to remove the "edit this page" links.
editUrl: 'https://gitee.com/gitee-ai/docs/edit/main/',
},
blog: {
showReadingTime: true,
// Please change this to your repo.
// Remove this to remove the "edit this page" links.
editUrl: 'https://gitee.com/gitee-ai/docs/edit/main/',
},
theme: {
customCss: './src/css/custom.css',
},
} satisfies Preset.Options,
],
],
themeConfig: {
// Replace with your project's social card
// image: 'img/docusaurus-social-card.jpg',
navbar: {
// title: 'Gitee AI',
logo: {
alt: 'Gitee AI',
src: `${CDN_PREFIX}/img/logo-full.svg`,
srcDark: `${CDN_PREFIX}/img/logo-full-white.svg`,
href: 'https://ai.gitee.com',
target: '_self',
style: {
paddingLeft: '8px',
},
},
items: [
{
type: 'html',
position: 'left',
className: 'gai-navbar-item-home',
value: '<a href="https://ai.gitee.com" target="_self">工作台</a>',
},
{
label: '模型广场',
to: 'https://ai.gitee.com/serverless-api',
target: '_self',
className: 'gai-navbar-item gai-navbar-item-badge',
},
{
label: '模型下载',
items: [
{
label: '模型下载',
to: 'https://ai.gitee.com/models',
target: '_self',
},
{
label: '数据集下载',
to: 'https://ai.gitee.com/datasets',
target: '_self',
},
],
},
{
label: '应用',
to: 'https://ai.gitee.com/apps',
target: '_self',
className: 'gai-navbar-item',
},
{
label: '解决方案',
items: [
{
label: '模型引擎',
to: 'https://ai.gitee.com/solutions/model-engine',
target: '_self',
},
{
label: '应用引擎',
to: 'https://ai.gitee.com/solutions/app-engine',
target: '_self',
},
{
label: 'GiEngine 高速推理引擎',
to: 'https://ai.gitee.com/solutions/serverless',
target: '_self',
},
{
label: '分布式算力网络',
to: 'https://ai.gitee.com/solutions/computing-network',
target: '_self',
},
{
label: '模型微调服务',
to: 'https://ai.gitee.com/solutions/training',
target: '_self',
},
],
},
{
label: '专区',
items: [
{
label: '昇腾计算',
to: 'https://ai.gitee.com/topics/ascend',
target: '_self',
},
{
label: '昇腾 AI 开发板',
to: 'https://ai.gitee.com/topics/ascend-edge',
target: '_self',
},
{
label: '天数智芯',
to: 'https://ai.gitee.com/topics/iluvatar',
target: '_self',
},
{
label: '沐曦',
to: 'https://ai.gitee.com/serverless-api/packages/1492',
target: '_self',
},
{
label: '科华(壁仞)',
to: 'https://ai.gitee.com/serverless-api/packages/2018',
target: '_self',
},
{
label: '燧原',
to: 'https://ai.gitee.com/serverless-api/packages/2057',
target: '_self',
},
{
label: '国产大模型',
to: 'https://ai.gitee.com/topics/domestic',
target: '_self',
},
{
label: 'AI 编程',
to: 'https://ai.gitee.com/topics/ai',
target: '_self',
},
],
},
{
label: '文档',
to: '/docs/getting-started/intro',
className: 'gai-navbar-item',
activeBaseRegex: '^/docs(?!/金牌客服马建仓).*',
},
{
label: 'AI 客服',
to: '/docs/金牌客服马建仓',
target: '_self',
className: 'gai-navbar-item',
},
],
},
footer: {
style: 'light',
/*
links: [
{
title: 'Docs',
items: [
{
label: 'Tutorial',
to: '/docs/intro',
},
],
},
{
title: 'Community',
items: [
{
label: 'Stack Overflow',
href: 'https://stackoverflow.com/questions/tagged/docusaurus',
},
{
label: 'Discord',
href: 'https://discordapp.com/invite/docusaurus',
},
{
label: 'Twitter',
href: 'https://twitter.com/docusaurus',
},
],
},
{
title: 'More',
items: [
{
label: 'Blog',
to: '/blog',
},
{
label: 'Gitee AI',
href: 'https://ai.gitee.com',
},
],
},
],
*/
copyright: `Copyright © ${new Date().getFullYear()} Gitee AI`,
},
prism: {
theme: prismThemes.github,
darkTheme: prismThemes.dracula,
},
zoom: {
selector: '.markdown img',
config: {},
},
} satisfies Preset.ThemeConfig,
plugins: [
'docusaurus-plugin-image-zoom',
// 添加自定义加载效果插件
require('./src/plugins/scalar-loading-plugin'),
[
'@scalar/docusaurus',
{
id: 'openapi/serverless',
label: '',
route: '/docs/openapi/serverless',
cdn: '/docs/@scalar/api-reference.v1.28.26.js',
showNavLink: false,
configuration: {
spec: {
url: 'https://ai.gitee.com/api/serverless/yaml',
},
hideModels: true,
servers: [
{
url: 'https://ai.gitee.com/api/serverless',
description: '生产服务器',
},
],
defaultOpenAllTags: true,
},
} as ScalarOptions,
],
[
'@scalar/docusaurus',
{
id: 'openapi/v1',
label: '接口文档',
route: '/docs/openapi/v1',
showNavLink: false,
configuration: {
metaData: {
title: '接口文档',
},
spec: {
url: 'https://ai.gitee.com/v1/yaml',
},
hideModels: true,
servers: [
{
url: 'https://ai.gitee.com/v1',
description: '生产服务器',
},
],
defaultOpenAllTags: true,
},
cdn: '/docs/@scalar/api-reference.v1.28.26.js',
} 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',
configureWebpack(config, isServer) {
return {
output: {
publicPath: `${CDN_PREFIX}/`, // 将静态资源的路径指向 CDN
},
};
},
};
},
],
};
export default config;
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/gitee-ai-opensource/docs.git
[email protected]:gitee-ai-opensource/docs.git
gitee-ai-opensource
docs
Gitee AI 文档
main

搜索帮助