代码拉取完成,页面将自动刷新
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 config: Config = {
title: 'Gitee AI',
tagline: '开发 AI 应用从此简单',
favicon: '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: 'img/logo-full.svg',
srcDark: '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: 'Serverless API',
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: '算力网络',
to: 'https://ai.gitee.com/solutions/computing-network',
target: '_self',
},
{
label: 'Serverless 推理引擎',
to: 'https://ai.gitee.com/solutions/serverless',
target: '_self',
},
],
},
{
label: '专区',
items: [
{
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/topics/sugon',
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',
[
'@scalar/docusaurus',
{
id: 'openapi/serverless',
label: '',
route: '/docs/openapi/serverless',
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',
configuration: {
spec: {
url: 'https://ai.gitee.com/v1/yaml',
},
hideModels: true,
servers: [
{
url: 'https://ai.gitee.com/v1',
description: '生产服务器',
},
],
},
} 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;
},
},
],
],
};
export default config;
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。