1
0
wiki/docusaurus.config.js

325 lines
9.4 KiB
JavaScript
Raw Normal View History

2022-01-12 15:43:01 +08:00
// @ts-check
// Note: type annotations allow type checking and IDEs autocompletion
2022-05-05 17:27:32 +08:00
const lightCodeTheme = require("prism-react-renderer/themes/github");
const darkCodeTheme = require("prism-react-renderer/themes/dracula");
2022-01-12 15:43:01 +08:00
/** @type {import('@docusaurus/types').Config} */
const config = {
2022-05-05 17:27:32 +08:00
title: "7Wate",
tagline: "For Freedom",
url: "https://wiki.7wate.com",
baseUrl: "/",
onBrokenLinks: "log",
onBrokenMarkdownLinks: "log",
favicon: "img/favicon.ico",
// GitHub pages deployment config.
// If you aren't using GitHub pages, you don't need these.
// organizationName: '7wate', // Usually your GitHub org/user name.
// projectName: 'wiki', // Usually your repo name.
// 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-06 17:41:50 +08:00
defaultLocale: "zh-Hans",
locales: ["zh-Hans"],
2022-05-05 17:27:32 +08:00
},
2022-01-12 15:43:01 +08:00
presets: [
[
2022-05-05 17:27:32 +08:00
"classic",
2022-01-12 15:43:01 +08:00
/** @type {import('@docusaurus/preset-classic').Options} */
({
docs: {
2022-05-05 17:27:32 +08:00
sidebarPath: require.resolve("./sidebars.js"),
editUrl: "https://git.7wate.com/zhouzhongping/wiki/src/branch/master",
2022-06-27 16:45:18 +08:00
showLastUpdateAuthor: true,
showLastUpdateTime: true,
breadcrumbs: false,
2022-01-12 15:43:01 +08:00
},
blog: {
2022-06-27 16:45:18 +08:00
blogTitle: "7Wate`s Blog",
blogDescription: "7Wate 的个人生活和工作记录",
blogSidebarCount: 7,
blogSidebarTitle: "文章",
2022-01-12 15:43:01 +08:00
showReadingTime: true,
2022-05-05 17:27:32 +08:00
editUrl: "https://git.7wate.com/zhouzhongping/wiki/src/branch/master",
2022-07-26 15:42:47 +08:00
feedOptions: {
2022-08-26 16:53:23 +08:00
title: "7Wate`s Blog",
description: "7Wate 的个人生活和工作记录",
2022-07-26 15:42:47 +08:00
type: 'all',
copyright: `Copyright © ${new Date().getFullYear()} 7Wate, Inc.`,
},
2022-01-12 15:43:01 +08:00
},
theme: {
2022-05-05 17:27:32 +08:00
customCss: require.resolve("./src/css/custom.css"),
2022-01-12 15:43:01 +08:00
},
2022-05-06 09:06:41 +08:00
sitemap: {
2022-06-27 16:45:18 +08:00
changefreq: "weekly",
2022-05-06 09:06:41 +08:00
priority: 0.5,
2022-07-26 15:42:47 +08:00
filename: 'sitemap.xml',
},
googleAnalytics: {
trackingID: "G-MHMEL0F832",
anonymizeIP: true,
},
gtag: {
trackingID: 'G-MHMEL0F832',
anonymizeIP: true,
2022-05-06 09:06:41 +08:00
},
2022-01-12 15:43:01 +08:00
}),
],
],
2022-05-05 17:27:32 +08:00
plugins: [
[
"@docusaurus/plugin-content-docs",
{
id: "dev",
path: "wiki/dev",
routeBasePath: "dev",
2022-05-05 17:27:32 +08:00
sidebarPath: require.resolve("./sidebars.js"),
editUrl: "https://git.7wate.com/zhouzhongping/wiki/src/branch/master",
2022-06-27 16:45:18 +08:00
showLastUpdateAuthor: true,
showLastUpdateTime: true,
breadcrumbs: false,
2022-05-05 17:27:32 +08:00
},
],
[
"@docusaurus/plugin-content-docs",
{
id: "algo",
path: "wiki/algo",
routeBasePath: "algo",
2022-05-05 17:27:32 +08:00
sidebarPath: require.resolve("./sidebars.js"),
editUrl: "https://git.7wate.com/zhouzhongping/wiki/src/branch/master",
2022-06-27 16:45:18 +08:00
showLastUpdateAuthor: true,
showLastUpdateTime: true,
breadcrumbs: false,
2022-05-05 17:27:32 +08:00
},
],
2022-08-27 21:08:09 +08:00
[
"@docusaurus/plugin-content-docs",
{
id: "struct",
path: "wiki/struct",
routeBasePath: "struct",
sidebarPath: require.resolve("./sidebars.js"),
editUrl: "https://git.7wate.com/zhouzhongping/wiki/src/branch/master",
showLastUpdateAuthor: true,
showLastUpdateTime: true,
breadcrumbs: false,
},
],
2022-06-16 10:48:37 +08:00
[
"@docusaurus/plugin-content-docs",
{
id: "ops",
path: "wiki/ops",
routeBasePath: "ops",
2022-06-16 10:48:37 +08:00
sidebarPath: require.resolve("./sidebars.js"),
editUrl: "https://git.7wate.com/zhouzhongping/wiki/src/branch/master",
2022-06-27 16:45:18 +08:00
showLastUpdateAuthor: true,
showLastUpdateTime: true,
breadcrumbs: false,
2022-06-16 10:48:37 +08:00
},
],
[
"@docusaurus/plugin-content-docs",
{
id: "safe",
path: "wiki/safe",
routeBasePath: "safe",
2022-06-16 10:48:37 +08:00
sidebarPath: require.resolve("./sidebars.js"),
editUrl: "https://git.7wate.com/zhouzhongping/wiki/src/branch/master",
2022-06-27 16:45:18 +08:00
showLastUpdateAuthor: true,
showLastUpdateTime: true,
breadcrumbs: false,
2022-06-16 10:48:37 +08:00
},
],
2022-06-16 10:48:37 +08:00
[
"@docusaurus/plugin-content-docs",
{
id: "org",
path: "group/organization",
routeBasePath: "org",
2022-06-16 10:48:37 +08:00
sidebarPath: require.resolve("./sidebars.js"),
editUrl: "https://git.7wate.com/zhouzhongping/wiki/src/branch/master",
2022-06-27 16:45:18 +08:00
showLastUpdateAuthor: true,
showLastUpdateTime: true,
breadcrumbs: false,
2022-06-16 10:48:37 +08:00
},
],
[
"@docusaurus/plugin-content-docs",
{
id: "com",
path: "group/company",
routeBasePath: "com",
2022-06-16 10:48:37 +08:00
sidebarPath: require.resolve("./sidebars.js"),
editUrl: "https://git.7wate.com/zhouzhongping/wiki/src/branch/master",
2022-06-27 16:45:18 +08:00
showLastUpdateAuthor: true,
showLastUpdateTime: true,
breadcrumbs: false,
2022-06-16 10:48:37 +08:00
},
],
2022-08-03 14:59:19 +08:00
[
"@docusaurus/plugin-content-docs",
{
id: "gov",
path: "group/government",
routeBasePath: "gov",
sidebarPath: require.resolve("./sidebars.js"),
editUrl: "https://git.7wate.com/zhouzhongping/wiki/src/branch/master",
showLastUpdateAuthor: true,
showLastUpdateTime: true,
breadcrumbs: false,
},
],
2022-06-16 10:48:37 +08:00
[
"@docusaurus/plugin-content-docs",
{
id: "life",
path: "life",
routeBasePath: "life",
2022-06-16 10:48:37 +08:00
sidebarPath: require.resolve("./sidebars.js"),
editUrl: "https://git.7wate.com/zhouzhongping/wiki/src/branch/master",
2022-06-27 16:45:18 +08:00
showLastUpdateAuthor: true,
showLastUpdateTime: true,
breadcrumbs: false,
2022-06-16 10:48:37 +08:00
},
],
[
"@docusaurus/plugin-content-docs",
{
2022-08-24 15:41:17 +08:00
id: "journal",
path: "journal",
routeBasePath: "journal",
2022-06-16 10:48:37 +08:00
sidebarPath: require.resolve("./sidebars.js"),
editUrl: "https://git.7wate.com/zhouzhongping/wiki/src/branch/master",
2022-06-27 16:45:18 +08:00
showLastUpdateAuthor: true,
showLastUpdateTime: true,
breadcrumbs: false,
2022-06-16 10:48:37 +08:00
},
],
2022-06-16 10:48:37 +08:00
[
"@docusaurus/plugin-content-docs",
{
id: "work",
path: "work",
routeBasePath: "work",
sidebarPath: require.resolve("./sidebars.js"),
editUrl: "https://git.7wate.com/zhouzhongping/wiki/src/branch/master",
2022-06-27 16:45:18 +08:00
showLastUpdateAuthor: true,
showLastUpdateTime: true,
breadcrumbs: false,
2022-06-16 10:48:37 +08:00
},
2022-07-26 15:42:47 +08:00
]
2022-04-29 11:28:04 +08:00
],
2022-01-12 15:43:01 +08:00
themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
2022-01-13 14:01:57 +08:00
// announcementBar: {
// id: 'support_us',
// content:
2022-08-03 14:59:19 +08:00
// 'Always For Freedom. The site by 7Wate.',
2022-01-13 14:01:57 +08:00
// backgroundColor: '#fafbfc',
// textColor: '#091E42',
// isCloseable: false,
// },
2022-05-05 17:27:32 +08:00
metadata: [
{
name: "keywords",
content: "7wate, wiki, blog, c, c++, java, python, linux",
},
],
2022-01-12 15:43:01 +08:00
navbar: {
2022-08-03 14:59:19 +08:00
title: "📚 7Wate's Wiki",
2022-05-05 17:27:32 +08:00
hideOnScroll: true,
2022-01-13 14:01:57 +08:00
// logo: {
// alt: 'Site Logo',
// src: 'img/logo.svg',
// srcDark: 'img/logo_dark.svg',
// href: 'https://docusaurus.io/',
// target: '_self',
// width: 32,
// height: 32,
// },
2022-01-12 15:43:01 +08:00
items: [
2022-06-16 10:48:37 +08:00
{ to: "/blog", label: "👨🏻‍🌾 博客", position: "right" },
2022-01-12 15:43:01 +08:00
{
2022-05-05 17:27:32 +08:00
position: "right",
2022-06-16 10:48:37 +08:00
label: "👨🏻‍🎓 维基",
items: [
{
2022-08-27 21:08:09 +08:00
label: "程序语言",
2022-06-16 10:48:37 +08:00
to: "/dev",
},
{
2022-08-27 21:08:09 +08:00
label: "数据结构",
to: "/struct",
},
{
2022-08-29 15:30:37 +08:00
label: "逻辑算法",
2022-06-16 10:48:37 +08:00
to: "/algo",
},
{
2022-08-03 14:59:19 +08:00
label: "网络运维",
2022-06-16 10:48:37 +08:00
to: "/ops",
},
{
2022-08-03 14:59:19 +08:00
label: "信息安全",
2022-06-16 10:48:37 +08:00
to: "/safe",
},
{
2022-08-03 14:59:19 +08:00
label: "其他文档",
2022-06-16 10:48:37 +08:00
to: "/docs",
},
],
2022-01-12 15:43:01 +08:00
},
{
position: "right",
label: "💼 组织",
items: [
{
2022-08-03 14:59:19 +08:00
label: "开源社区",
to: "/org",
},
{
2022-08-03 14:59:19 +08:00
label: "现代企业",
to: "/com",
},
2022-08-03 14:59:19 +08:00
{
label: "国家政府",
to: "/gov",
},
]
},
2022-06-16 10:48:37 +08:00
{ to: "/work", label: "👨‍💻 职业", position: "right" },
{ to: "/life", label: "🚴🏻‍♀️ 生活", position: "right" },
2022-08-24 15:41:17 +08:00
{ to: "/journal", label: "📽️ 日志", position: "right" },
2022-01-12 15:43:01 +08:00
],
},
2022-06-27 16:45:18 +08:00
algolia: {
apiKey: "5d5a02bdf02df700355c8ccd84b78d13",
appId: "8W3YJXJGF2",
indexName: "wiki",
},
2022-01-12 15:43:01 +08:00
footer: {
2022-05-05 17:27:32 +08:00
style: "dark",
2022-02-25 08:52:21 +08:00
copyright: `Copyright © ${new Date().getFullYear()} 7Wate, Inc. Built with <a href="https://www.docusaurus.cn/" target="_blank" rel="noopener noreferrer">Docusaurus</a>.<br>Powered by <a href="https://webify.cloudbase.net/" target="_blank" rel="noopener noreferrer">CloudBase Webify</a>`,
2022-01-12 15:43:01 +08:00
},
prism: {
theme: lightCodeTheme,
darkTheme: darkCodeTheme,
2022-05-05 17:27:32 +08:00
defaultLanguage: "markdown",
2022-08-31 15:59:07 +08:00
additionalLanguages: ["java", "git","nginx","http"],
2022-05-05 17:27:32 +08:00
},
2022-01-12 15:43:01 +08:00
}),
};
module.exports = config;