-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathdocusaurus.config.js
172 lines (171 loc) · 5.26 KB
/
docusaurus.config.js
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
const lightCodeTheme = require('prism-react-renderer/themes/github');
const darkCodeTheme = require('prism-react-renderer/themes/dracula');
const path = require('path');
/** @type {import('@docusaurus/types').DocusaurusConfig} */
module.exports = {
presets: [
[
'@docusaurus/preset-classic',
{
docs: {
path: 'docs',
routeBasePath: '/',
sidebarPath: require.resolve('./sidebars.json'),
},
theme: {
customCss: require.resolve('./src/css/custom.css'),
},
sitemap: {
changefreq: 'daily',
priority: 0.7,
},
},
],
],
plugins: [
path.resolve('src/plugins/fathom'),
],
title: 'Buf™',
tagline: 'Building a better way to work with Protocol Buffers',
url: 'https://docs.buf.build',
baseUrl: '/',
favicon: 'img/favicon.ico',
onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'warn',
organizationName: 'bufbuild',
projectName: 'buf',
// Ref: https://docusaurus.io/docs/2.0.0-beta.3/api/themes/configuration
themeConfig: {
algolia: {
apiKey: process.env.ALGOLIA_API_KEY || 'none',
indexName: process.env.ALGOLIA_INDEX_NAME || 'none',
},
fathomAnalytics: {
siteId: process.env.FATHOM_ANALYTICS_SITE_ID || 'none',
customDomain: process.env.FATHOM_ANALYTICS_CUSTOM_DOMAIN || 'none',
},
navbar: {
// We override the theme's navbar and support the additional option "bufAppearance"
// on links. It can have one of the following values:
// - "button" - styles the link as a dark button
// - "slack" - styles the link as a light button with a slack icon
// - "github" - styles the link as a light button with a github icon
// For the "github" appearance, the stargazer count for the GitHub repository is
// rendered as the link label (this requires a "href" to a GitHub repository).
hideOnScroll: false,
title: 'Docs',
logo: {
alt: 'Buf Logo',
src: 'img/logo.svg',
href: 'https://docs.buf.build',
target: '_self',
},
items: [
{
// The search bar must be the first item on the left - otherwise, the layout of the
// overridden navbar will break.
type: "search",
position: 'left',
},
{
href: 'https://buf.build/blog',
label: 'Blog',
position: 'right',
},
{
href: 'https://buf.build/careers',
label: 'Careers',
position: 'right',
},
{
href: 'https://buf.build/login',
label: 'Sign in',
position: 'right',
bufAppearance: 'button'
},
{
href: 'https://buf.build/signup',
label: 'Sign Up',
position: 'right',
bufAppearance: 'dark-button'
},
{
href: 'https://join.slack.com/t/bufbuild/shared_invite/zt-f5k547ki-VDs_iC4TblNCu7ubhRD17w',
label: 'Slack',
position: 'right',
bufAppearance: 'slack'
},
{
href: 'https://github.com/bufbuild/buf',
label: 'GitHub',
position: 'right',
bufAppearance: 'github'
},
],
},
footer: {
// We override the theme's footer and don't support all standard footer options here.
// The "style" and "logo" properties will be ignored, and we only render links in the
// categories "Social" and "Legal".
links: [
{
// Social links are rendered with an icon based on the URL.
// If we do not have an icon for the URL, the label is rendered instead.
title: 'Social',
items: [
{
label: 'Twitter',
href: 'https://twitter.com/bufbuild',
},
{
label: 'LinkedIn',
href: 'https://www.linkedin.com/company/bufbuild',
},
{
label: 'Mail',
href: 'mailto:[email protected]',
},
],
},
{
// Legal links require a label.
// Note that space is constrained - adding more links will break the layout.
title: 'Legal',
items: [
{
label: 'Terms Of Use',
href: 'https://buf.build/resources/terms',
},
{
label: 'Privacy Policy',
href: 'https://buf.build/resources/privacy',
},
{
label: 'Cookie Policy',
href: 'https://buf.build/resources/cookie-policy',
},
],
},
],
copyright: `© ${new Date().getFullYear()} Buf Technologies, Inc.`,
},
image: 'img/logo.svg',
colorMode: {
defaultMode: 'light',
// Hides the switch in the navbar
disableSwitch: true,
// Should we use the prefers-color-scheme media-query,
// using user system preferences, instead of the hardcoded defaultMode?
respectPrefersColorScheme: false,
},
prism: {
theme: lightCodeTheme,
darkTheme: darkCodeTheme,
additionalLanguages: ['protobuf'],
},
},
customFields: {
// Used to configure the release version downloaded from the installation.mdx buttons
downloadRelease: '1.0.0-rc6',
},
};