forked from rcxxx/docusaurus-template
-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathdocusaurus.config.js
More file actions
105 lines (90 loc) · 2.94 KB
/
docusaurus.config.js
File metadata and controls
105 lines (90 loc) · 2.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
module.exports = {
title: "Someone's Site", // 站点名称
tagline: 'The tagline of this site', // 站点描述
onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'warn',
favicon: 'img/favicon.ico', // 站点的图标
url: 'https://your-docusaurus-test-site.com', // GitHub 页面的 URL
baseUrl: '/', // 项目的基本 URL 设置为 /仓库名/
organizationName: '', // 设置为 Github 用户名
projectName: '', // 设置为 Github 仓库名
themeConfig: {
// 配置搜索栏需要到 algolia 配置
// algolia: {
// apiKey: 'YOUR_API_KEY',
// indexName: 'YOUR_INDEX_NAME',
// // Optional: see doc section bellow
// contextualSearch: true,
// // Optional: Algolia search parameters
// searchParameters: {},
// //... other Algolia params
// },
// 导航栏配置
navbar: {
title: "Someone's Site", // 名称
// 设置logo 如果需要可以取消注释 logo文件推荐转为 .svg 格式
// logo: {
// alt: 'My Site Logo',
// src: 'img/logo.svg',
// },
// 导航栏上的按钮 按照相应的格式可以创建新的按钮
items: [
{
to: '/', // 要跳转的页面
label: 'Blog', // 按钮名称
position: 'left' // 按钮位于左边还是右边
},
{
to: 'docs/',
activeBasePath: 'docs',
label: 'Docs',
position: 'left',
},
{
href: 'https://github.com/rcxxx/docusaurus-template', // 如果要跳转链接则使用 herf
label: '本站源码',
position: 'right',
},
],
},
// 页脚配置
footer: {
style: 'dark', // 页脚风格
links: [
// 同样的方式创建一个分类
{
title: 'Docs',
// 同样的格式创建新的按钮
items: [
{
label: 'start', // 标签
to: 'docs/', // 要跳转的页面
},
],
},
],
copyright: `Copyright © ${new Date().getFullYear()} My Project, Inc. Built with Docusaurus.`,
},
},
presets: [
[
'@docusaurus/preset-classic',
{
blog: {
showReadingTime: true,
path: "./blog",
routeBasePath: "/", // 这里将 blog/ 设置为首页
},
docs: {
sidebarPath: require.resolve('./sidebars.js'),
// 修改为自己的链接,在文章底部添加编辑此页面的链接
// editUrl:
// 'https://github.com/facebook/docusaurus/edit/master/website/',
},
theme: {
customCss: require.resolve('./src/css/custom.css'),
},
},
],
],
};