forked from dwmkerr/effective-shell
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docusaurus.config.js
200 lines (188 loc) · 5.71 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
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
// @ts-check
// Note: type annotations allow type checking and IDEs autocompletion
const lightCodeTheme = require('prism-react-renderer/themes/github');
const darkCodeTheme = require('prism-react-renderer/themes/dracula');
// Load our package so we can show metadata like the version.
const packageJson = require('./package.json');
const title = 'Effective Shell';
const organizationName = 'dwmkerr';
const projectName = 'effective-shell';
const githubRepoUrl = `https://github.com/${organizationName}/${projectName}/`
const editUrl = `${githubRepoUrl}/edit/main/`;
/** @type {import('@docusaurus/types').Config} */
const config = {
title: title,
tagline: 'Essential techniques for the modern technologist',
url: 'https://effective-shell.com',
baseUrl: '/',
onBrokenLinks: 'warn',
onBrokenMarkdownLinks: 'throw',
favicon: 'img/favicon.png',
organizationName: organizationName,
projectName: projectName,
presets: [
[
'classic',
/** @type {import('@docusaurus/preset-classic').Options} */
({
// Configure the site to docs-only mode:
// https://docusaurus.io/docs/docs-introduction#docs-only-mode
docs: {
sidebarPath: require.resolve('./sidebars.js'),
// We don't need the breadcrumbs as we don't have much nesting and
// they distract from the core content at the top of each page.
breadcrumbs: false,
// Set the route base path - it doesn't need 'docs' or 'blog' as we
// only have a single set of documents to show.
routeBasePath: '/',
// Set the edit URL to allow users to open pull requests easily.
editUrl: editUrl,
},
blog: false,
theme: {
// It looks like Docosaurus doesn't yet support directly importing
// this style in the EmailSignupForm component, so as a workaround
// it is imported here, along with other stylesheets we need.
customCss: [
require.resolve('react-mailchimp-email-signup-form/dist/esm/index.css'),
require.resolve('asciinema-player/dist/bundle/asciinema-player.css'),
],
// Add theming support for languages we use.
// prism: {
// additionalLanguages: [],
// },
},
gtag: {
trackingID: 'G-8HZFMZV9Z4',
anonymizeIP: true,
},
}),
],
],
themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
navbar: {
title: title,
logo: {
alt: 'Effective Shell Logo',
src: 'img/logo.png',
},
items: [
{
type: 'doc',
docId: 'index',
position: 'left',
label: 'Home',
},
{
to: 'donate',
label: 'Donate',
position: 'left'
},
{
type: 'search',
position: 'right',
},
{
href: githubRepoUrl,
label: 'GitHub',
position: 'right',
},
],
},
footer: {
style: 'dark',
links: [
{
title: 'Effective Shell',
items: [
{
label: 'Home',
to: '/',
},
{
to: 'donate',
label: 'Donate',
},
],
},
{
title: 'Community',
items: [
{
label: 'GitHub',
href: 'https://github.com/dwmkerr/effective-shell',
},
{
label: 'Twitter',
href: 'https://twitter.com/dwmkerr',
},
],
},
],
copyright: `Effective Shell v${packageJson.version}. Copyright © ${new Date().getFullYear()} Dave Kerr. Website built with Docusaurus.`,
},
prism: {
theme: lightCodeTheme,
darkTheme: darkCodeTheme,
},
liveCodeBlock: {
/**
* The position of the live playground, above or under the editor
* Possible values: "top" | "bottom"
* We use 'top' as we are currently using this editor to preview
* components, and we want to show the rendered component before its
* code (see 'Developer Guide > Components').
*/
playgroundPosition: 'top',
},
metadata: [{
name: 'google-site-verification',
content: 'ca-pub-6181461532532600',
}],
}),
plugins: [
[
require.resolve('docusaurus-plugin-drawio'),
{}
],
[
require.resolve('@docusaurus/theme-live-codeblock'),
{}
],
// Ideal Image seems to clash with Docusaurus native lazy loading, causing
// most images not to load. So disabling this for now.
// [
// require.resolve('@docusaurus/plugin-ideal-image'),
// {
// // Enable this plugin in dev so that we can test it.
// disableInDev: false,
// },
// ],
],
themes: [
[
require.resolve('@easyops-cn/docusaurus-search-local'),
{
// `hashed` is recommended as long-term-cache of index file is possible.
hashed: true,
indexDocs: true,
indexBlog: false,
docsRouteBasePath: ['/'],
docsDir: 'docs',
highlightSearchTermsOnTargetPage: true,
language: ['en'],
},
],
],
scripts: [{
src:
'https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-6181461532532600',
async: true,
}, {
src: "https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-6181461532532600",
async: true,
}],
};
module.exports = config;