1
0
wiki/docusaurus.config.js

289 lines
8.5 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: {
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: "life",
path: "life",
routeBasePath: "life",
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: "art",
path: "art",
routeBasePath: "art",
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-06-16 10:48:37 +08:00
[
"@docusaurus/plugin-content-docs",
{
id: "dev",
path: "dev",
routeBasePath: "dev",
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: "algo",
path: "algo",
routeBasePath: "algo",
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: "ops",
path: "ops",
routeBasePath: "ops",
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: "safe",
routeBasePath: "safe",
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: "othe",
path: "othe",
routeBasePath: "othe",
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: "org",
path: "org",
routeBasePath: "org",
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: "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-06-27 16:45:18 +08:00
// themes: [
// [
// require.resolve("@easyops-cn/docusaurus-search-local"),
// {
// // ... Your options.
// // `hashed` is recommended as long-term-cache of index file is possible.
// hashed: true,
// // For Docs using Chinese, The `language` is recommended to set to:
// // ```
// language: ["en", "zh"],
// // ```
// },
// ],
// ],
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:
// 'We are looking to revamp our docs, please fill <a target="_blank" rel="noopener noreferrer" href="#">this survey</a>',
// 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-06-16 10:48:37 +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: [
{
label: "开发",
to: "/dev",
},
{
label: "算法",
to: "/algo",
},
{
label: "运维",
to: "/ops",
},
{
label: "安全",
to: "/safe",
},
{
label: "其他",
to: "/docs",
},
],
2022-01-12 15:43:01 +08:00
},
2022-06-16 10:48:37 +08:00
{ to: "/org", label: "🤶 社区", position: "right" },
{ to: "/work", label: "👨‍💻 职业", position: "right" },
{ to: "/life", label: "🚴🏻‍♀️ 生活", position: "right" },
{ to: "/art", 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",
additionalLanguages: ["java", "git"],
},
2022-01-12 15:43:01 +08:00
}),
};
module.exports = config;