-
-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathdocusaurus.config.ts
172 lines (153 loc) · 3.73 KB
/
docusaurus.config.ts
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
import type { Config } from '@docusaurus/types'
import blog from './config/blog.config'
import docs from './config/docs.config'
import i18n from './config/i18n.config'
import navbar from './config/navbar.config'
import theme from './config/theme.config'
// Site metadata constants
const SITE_URL = 'https://cho.sh'
const CDN_BASE = 'https://cdn.jsdelivr.net'
// Create async config to allow for dynamic content
const config: Config = {
title: 'cho.sh',
tagline: 'I travel the WWW.',
titleDelimiter: '@',
url: SITE_URL,
baseUrl: '/',
// File handling configurations
onBrokenLinks: 'warn',
onBrokenMarkdownLinks: 'warn',
onBrokenAnchors: 'warn',
onDuplicateRoutes: 'warn',
trailingSlash: false,
favicon: 'img/favicon.svg',
// Repository info
organizationName: 'anaclumos',
projectName: 'extracranial',
// Internationalization
i18n,
baseUrlIssueBanner: false,
// Performance optimizations
future: {
experimental_faster: true,
},
// Markdown configuration
markdown: {
format: 'mdx',
mermaid: true,
mdx1Compat: {
comments: true,
admonitions: true,
headingIds: true,
},
remarkRehypeOptions: {
footnoteLabel: 'Footnotes',
},
anchors: {
maintainCase: true,
},
},
// Main presets configuration
presets: [
[
'classic',
{
docs,
blog,
theme,
gtag: {
trackingID: 'G-7GMRW82QVZ',
anonymizeIP: true,
},
},
],
[
'@docusaurus/plugin-client-redirects',
{
createRedirects: (existingPath: string): string[] | undefined => {
// Handle blog and research redirects
if (existingPath.includes('/blog') || existingPath.includes('/research')) {
return [existingPath.replace('/blog/', '/w/'), existingPath.replace('/research/', '/r/')]
}
// Handle /r redirects
if (existingPath.endsWith('/r') || existingPath.endsWith('/r/')) {
return ['/r/000000']
}
return undefined
},
},
],
],
// External resources with performance optimizations
stylesheets: [
{
href: `${CDN_BASE}/npm/katex@latest/dist/katex.min.css`,
type: 'text/css',
rel: 'stylesheet',
crossorigin: 'anonymous',
as: 'style',
},
{
href: 'https://statics.goorm.io/fonts/GoormSansCode/latest/GoormSansCode.min.css',
type: 'text/css',
rel: 'stylesheet',
crossorigin: 'anonymous',
as: 'style',
},
],
// Theme configuration
themeConfig: {
// Search configuration
algolia: {
appId: 'YYIGMBHSI6',
apiKey: '4f28c78c43e91f6f922d20140434977f',
indexName: 'cho',
contextualSearch: true,
searchParameters: {},
searchPagePath: 'search',
debug: false,
},
// Theme settings
colorMode: {
defaultMode: 'dark',
respectPrefersColorScheme: true,
},
navbar,
// Syntax highlighting
prism: {
additionalLanguages: ['java', 'swift', 'diff', 'docker'],
},
// Documentation settings
tableOfContents: {
minHeadingLevel: 2,
maxHeadingLevel: 6,
},
docs: {
sidebar: {
hideable: true,
autoCollapseCategories: false,
},
},
// Mermaid diagram settings
mermaid: {
options: {
fontFamily: 'var(--font-family-monospace)',
themeVariables: {
darkMode: true,
},
},
},
},
// Analytics script with performance attributes
scripts: [
{
src: 'https://sa.cho.sh/latest.js',
async: true,
defer: true,
'data-collect-dnt': 'true',
strategy: 'lazyOnload',
},
],
themes: ['@docusaurus/theme-mermaid'],
}
export default config