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

114 lines
3.1 KiB
JavaScript
Raw Permalink 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 v2.x 社区分叉版本,提供了大量的新特性、性能改进与修复。',
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,
},
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',
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
{
href: 'https://smallmain.github.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',
label: 'Github',
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;