NitWikit/docusaurus.config.js
2024-03-23 13:32:09 +08:00

153 lines
3.9 KiB
JavaScript

// @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 = {
title: '笨蛋开服教程',
tagline: '一群笨蛋们写的开服教程',
favicon: 'img/favicon.ico',
// Set the production url of your site here
url: 'https://postyizhan.github.io',
// Set the /<baseUrl>/ pathname under which your site is served
// For GitHub pages deployment, it is often '/<projectName>/'
baseUrl: '/Dumb_Service_Guide/',
// GitHub pages deployment config.
// If you aren't using GitHub pages, you don't need these.
organizationName: 'postyizhan', // Usually your GitHub org/user name.
projectName: 'Dumb_Service_Guide', // Usually your repo name.
deploymentBranch: 'gh-pages',
trailingSlash: false,
onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'warn',
// 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: {
defaultLocale: 'zh-Hans',
locales: ['zh-Hans', 'en'],
},
presets: [
[
'classic',
/** @type {import('@docusaurus/preset-classic').Options} */
({
docs: {
sidebarPath: require.resolve('./sidebars.js'),
routeBasePath: '/',
editUrl:
'https://github.com/postyizhan/Dumb_Service_Guide/blob/main'
},
blog: false,
theme: {
customCss: require.resolve('./src/css/custom.css'),
},
}),
],
],
themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
// Replace with your project's social card
image: 'img/docusaurus-social-card.jpg',
navbar: {
title: 'Dumb_Service_Guide',
logo: {
alt: 'Logo',
src: 'img/logo.svg',
},
hideOnScroll: false,
items: [
{
type: 'doc',
docId: 'intro',
position: 'left',
label: '开始',
},
// 搜索框
{
type: 'search',
position: 'right',
},
{
href: 'https://github.com/postyizhan/Dumb_Service_Guide',
label: 'GitHub',
position: 'right',
},
{
type: 'localeDropdown',
position: 'right',
},
],
},
// 底部链接
footer: {
style: 'dark',
links: [
{
title: '文档',
items: [
{
label: '开始',
to: '/intro',
},
],
},
{
title: '交流',
items: [
{
label: 'QQ群',
href: 'https://qm.qq.com/q/dENGavSflK',
},
],
},
{
title: '插件发布',
items: [
{
label: 'GitHub',
href: 'https://github.com/postyizhan/Dumb_Service_Guide',
},
],
},
],
// 底部版权信息
copyright: `Copyright © ${new Date().getFullYear()} Neige, All Rights Reserved.`,
},
// 深浅主题
prism: {
theme: lightCodeTheme,
darkTheme: darkCodeTheme,
},
// 颜色随系统切换
colorMode: {
respectPrefersColorScheme: true,
},
}),
themes: [
[
require.resolve("@easyops-cn/docusaurus-search-local"),
{
hashed: true,
language: ["en", "zh"],
highlightSearchTermsOnTargetPage: true,
explicitSearchResultPath: true,
indexBlog: false,
docsRouteBasePath: "/"
},
],
],
};
module.exports = config;