-
Notifications
You must be signed in to change notification settings - Fork 20
/
docusaurus.config.js
181 lines (176 loc) · 4.84 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
173
174
175
176
177
178
179
180
181
// Copyright 2022-2023 The Connect Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// @ts-check
const lightCodeTheme = require("prism-react-renderer").themes.github;
const darkCodeTheme = require("prism-react-renderer").themes.dracula;
const gaTrackingID = process.env.GOOGLE_ANALYTICS_GTAG ?? "";
const publicUrl =
process.env.NEXT_PUBLIC_VERCEL_URL === undefined
? "https://connectrpc.com"
: `https://${process.env.NEXT_PUBLIC_VERCEL_URL}`;
/** @type {import('@docusaurus/types').Config} */
const config = {
title: "Connect",
tagline: "Simple, reliable, interoperable: Protobuf RPC that works.", // Used for description metadata
url: publicUrl,
baseUrl: "/",
onBrokenLinks: "throw",
onBrokenMarkdownLinks: "warn",
favicon: "img/[email protected]",
organizationName: "connectrpc",
projectName: "connect",
scripts: [
{
src: "https://cdn.usefathom.com/script.js",
"data-site": "BWSMOXXQ",
"data-spa": "auto",
defer: true,
},
],
headTags: [
// Declare some json-ld structured data
{
tagName: "script",
attributes: {
type: "application/ld+json",
},
innerHTML: JSON.stringify({
"@context": "https://schema.org/",
"@type": "WebSite",
name: "Protobuf RPC that works",
url: "https://connectrpc.com/",
}),
},
{
tagName: "meta",
attributes: {
property: "og:site_name",
content: "Protobuf RPC that works",
},
},
],
presets: [
[
"classic",
/** @type {import('@docusaurus/preset-classic').Options} **/
({
docs: {
sidebarPath: require.resolve("./sidebars.js"),
},
blog: {
showReadingTime: true,
},
theme: {
customCss: require.resolve("./src/css/custom.css"),
},
}),
],
],
plugins: [
gaTrackingID !== ""
? [
"@docusaurus/plugin-google-gtag",
{
trackingID: gaTrackingID,
anonymizeIP: true,
},
]
: null,
],
themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
metadata: [
{
name: "description",
content: "Simple, reliable, interoperable: Protobuf RPC that works.",
},
{
name: "og:type",
content: "website",
},
{
name: "og:image",
content: `${publicUrl}/img/[email protected]`,
},
{
name: "twitter:card",
content: "summary_large_image",
},
{
name: "twitter:image",
content: `${publicUrl}/img/[email protected]`,
},
{
name: "twitter:domain",
content: publicUrl.replace(/^https?:\/\//, ""),
},
{
name: "twitter:url",
content: publicUrl,
},
{
name: "twitter:title",
content: "Connect",
},
{
name: "twitter:description",
content: "Simple, reliable, interoperable: Protobuf RPC that works.",
},
],
colorMode: {
// We can re-enable later if/when we have design assets
disableSwitch: true,
},
algolia: {
appId: process.env.ALGOLIA_APP_ID || "none",
apiKey: process.env.ALGOLIA_API_KEY || "none",
indexName: process.env.ALGOLIA_INDEX_NAME || "none",
},
navbar: {
title: "Connect",
logo: {
alt: "Connect logo",
src: "img/logos/simple-connect.svg",
},
items: [
{ to: "/docs/introduction", label: "Docs", position: "left" },
{
to: "https://github.com/connectrpc",
label: "GitHub",
position: "left",
},
{
to: "https://buf.build/links/slack",
label: "Slack",
position: "left",
},
{ to: "/demo", label: "Demo", position: "left" },
],
},
footer: {
style: "dark",
links: [],
copyright: `Copyright © ${
new Date().getFullYear() != 2022 ? "2022–" : ""
}${new Date().getFullYear()} The Connect Authors`,
},
prism: {
theme: lightCodeTheme,
darkTheme: darkCodeTheme,
additionalLanguages: ["kotlin", "protobuf", "swift", "dart"],
},
}),
};
module.exports = config;