cocos-enhance-kit/docs/docusaurus.config.js

125 lines
3.3 KiB
JavaScript
Raw Normal View History

// @ts-check
// Note: type annotations allow type checking and IDEs autocompletion
const lightCodeTheme = require('prism-react-renderer/themes/github');
const darkCodeTheme = require('prism-react-renderer/themes/dracula');
/** @type {import('@docusaurus/types').Config} */
const config = {
2022-07-11 04:10:40 +00:00
title: 'Cocos Enhance Kit',
tagline: '提供 Cocos Creator 引擎特性增强、修复与优化的开源非官方增强包',
2022-06-01 06:40:10 +00:00
url: 'https://smallmain.github.io',
2022-07-11 04:10:40 +00:00
baseUrl: '/cocos-enhance-kit/',
onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'warn',
favicon: 'img/favicon.ico',
// GitHub pages deployment config.
// If you aren't using GitHub pages, you don't need these.
organizationName: 'smallmain', // Usually your GitHub org/user name.
2022-07-11 04:10:40 +00:00
projectName: 'cocos-enhance-kit', // Usually your repo name.
2022-05-20 03:31:56 +00:00
deploymentBranch: 'gh-pages',
// Even if you don't use internalization, 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: {
2022-05-20 08:41:38 +00:00
defaultLocale: 'zh',
locales: ['zh'],
},
presets: [
[
'classic',
/** @type {import('@docusaurus/preset-classic').Options} */
({
docs: {
sidebarPath: require.resolve('./sidebars.js'),
2022-07-12 16:18:48 +00:00
includeCurrentVersion: true,
2022-07-06 07:42:23 +00:00
versions: {
2022-07-12 16:18:48 +00:00
"1.1.0": {
label: "v1.1.0",
},
2022-07-06 07:42:23 +00:00
"1.0.0": {
label: "v1.0.0",
}
}
},
blog: {
showReadingTime: true,
},
theme: {
customCss: require.resolve('./src/css/custom.css'),
},
}),
],
],
themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
navbar: {
2022-07-11 04:10:40 +00:00
title: 'Cocos Enhance Kit',
2022-05-20 08:41:38 +00:00
// style: 'primary',
logo: {
2022-07-11 04:10:40 +00:00
alt: 'Cocos Enhance Kit',
2022-05-20 08:41:38 +00:00
src: 'img/logo.png',
},
items: [
2022-05-20 08:41:38 +00:00
{
to: '/',
label: '首页',
activeBaseRegex: '/$',
position: 'right',
},
{
type: 'doc',
docId: 'intro',
2022-05-20 08:41:38 +00:00
position: 'right',
label: '文档',
},
2022-06-09 13:29:25 +00:00
{
2022-07-11 04:10:40 +00:00
href: 'https://smallmain.gitee.io/cocos-enhance-kit/demo/v1.0.0/web-desktop/index.html',
2022-06-09 13:29:25 +00:00
label: '演示',
position: 'right',
},
2022-07-06 07:42:23 +00:00
{
type: 'docsVersionDropdown',
position: 'right',
// dropdownItemsAfter: [{ to: '/versions', label: 'All versions' }],
dropdownActiveClassDisabled: true,
},
2022-05-20 08:41:38 +00:00
// { to: '/blog', label: 'Blog', position: 'left' },
{
2022-07-11 04:10:40 +00:00
href: 'https://github.com/smallmain/cocos-enhance-kit',
2022-06-01 06:40:10 +00:00
label: '加星鼓励',
position: 'right',
2022-06-01 06:40:10 +00:00
className: 'header-github-link',
},
2022-05-20 08:41:38 +00:00
{
type: 'search',
position: 'right',
},
],
},
prism: {
theme: lightCodeTheme,
darkTheme: darkCodeTheme,
},
}),
2022-05-20 08:41:38 +00:00
themes: [
[
require.resolve("@easyops-cn/docusaurus-search-local"),
{
hashed: true,
indexPages: true,
language: ['en', 'zh'],
removeDefaultStemmer: true,
searchResultLimits: 10,
},
],
],
};
module.exports = config;