-
Notifications
You must be signed in to change notification settings - Fork 58
Expand file tree
/
Copy pathdocusaurus.config.js
More file actions
189 lines (177 loc) · 6.27 KB
/
Copy pathdocusaurus.config.js
File metadata and controls
189 lines (177 loc) · 6.27 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
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
// @ts-check
import { themes as prismThemes } from 'prism-react-renderer';
/** @type {import('@docusaurus/types').Config} */
const config = {
title: 'C# Learning Resources — Labinator',
tagline: 'Every C# feature, indexed and current.',
favicon: 'img/favicon.svg',
// Confirmed from docs/mindmap.html's pre-existing og:image/twitter:image meta tags (Task 5).
url: 'https://csharp-cheatsheet.labinator.com',
baseUrl: '/',
organizationName: 'LabinatorSolutions',
projectName: 'csharp-cheatsheet',
onBrokenLinks: 'throw',
// concise-reference.md and ultimate-cheatsheet.md ship in legacy 'md' format
// (see markdown.format below), and Docusaurus's own broken-anchor checker
// doesn't see anchors correctly on 'md'-format pages — it flags real,
// working in-page links as broken. Verified every flagged anchor actually
// exists as a rendered element id (grepped the built HTML) and resolves
// correctly via rumdl's independent MD051 check (which has zero findings
// with the rule fully enabled). This is a known Docusaurus limitation for
// this parser mode, not a real broken link — 'ignore' silences the false
// positive rather than a genuine problem.
onBrokenAnchors: 'ignore',
// Content is full of bare C# generic syntax (List<T>, Dictionary<TKey,TValue>)
// outside fenced code blocks, which the default MDX parser reads as unclosed
// JSX tags. 'detect' uses the legacy Markdown parser for every .md file
// (all our content is .md, never .mdx) — sidesteps JSX parsing entirely.
// Discovered during Task 2's scaffold verification.
markdown: {
format: 'detect',
hooks: { onBrokenMarkdownLinks: 'warn' },
},
i18n: { defaultLocale: 'en', locales: ['en'] },
headTags: [
{
tagName: 'script',
attributes: { type: 'application/ld+json' },
innerHTML: JSON.stringify({
'@context': 'https://schema.org',
'@graph': [
{
'@type': 'Organization',
'@id': 'https://labinator.com/#organization',
name: 'Labinator',
url: 'https://labinator.com',
logo: 'https://csharp-cheatsheet.labinator.com/img/favicon.svg',
sameAs: [
'https://labinator.com',
'https://github.com/LabinatorSolutions',
],
},
{
'@type': 'WebSite',
'@id': 'https://csharp-cheatsheet.labinator.com/#website',
name: 'C# Learning Resources',
url: 'https://csharp-cheatsheet.labinator.com',
description:
'Every C# feature, indexed and current — a concise reference, an ultimate cheatsheet, a comprehensive reference, and an interactive mind map.',
inLanguage: 'en',
publisher: { '@id': 'https://labinator.com/#organization' },
potentialAction: {
'@type': 'SearchAction',
target: {
'@type': 'EntryPoint',
urlTemplate:
'https://csharp-cheatsheet.labinator.com/search?q={search_term_string}',
},
'query-input': 'required name=search_term_string',
},
},
],
}),
},
],
presets: [
[
'classic',
/** @type {import('@docusaurus/preset-classic').Options} */
({
docs: {
routeBasePath: 'docs',
sidebarPath: './sidebars.js',
editUrl:
'https://github.com/LabinatorSolutions/csharp-cheatsheet/tree/main/',
},
blog: false,
theme: { customCss: './src/css/custom.css' },
}),
],
],
themes: [
[
require.resolve('@easyops-cn/docusaurus-search-local'),
{ hashed: true, language: ['en'] },
],
],
themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
image: 'img/og-image.png',
metadata: [
{
name: 'description',
content:
'Every C# feature, indexed and current — a concise reference, an ultimate cheatsheet, a comprehensive reference, and an interactive mind map.',
},
{
name: 'keywords',
content:
'c# cheatsheet, c# reference, csharp cheat sheet, c# features, learn c#, .net, c# quick reference',
},
],
colorMode: {
defaultMode: 'light',
disableSwitch: true,
respectPrefersColorScheme: false,
},
navbar: {
title: 'Labinator',
logo: { alt: 'Labinator', src: 'img/favicon.svg' },
items: [
{
type: 'docSidebar',
sidebarId: 'referenceSidebar',
position: 'left',
label: 'Docs',
},
{
href: 'pathname:///mindmap.html',
label: 'Mindmap',
position: 'left',
},
{
href: 'https://github.com/LabinatorSolutions/csharp-cheatsheet',
label: 'GitHub',
position: 'right',
},
],
},
footer: {
style: 'light',
links: [
{
title: 'References',
items: [
{ label: 'Concise Reference', to: '/docs/concise-reference' },
{ label: 'Ultimate Cheatsheet', to: '/docs/ultimate-cheatsheet' },
{
label: 'Comprehensive Reference',
to: '/docs/comprehensive-reference',
},
{ label: 'Mindmap', href: 'pathname:///mindmap.html' },
],
},
{
title: 'Elsewhere',
items: [
{ label: 'Labinator.com', href: 'https://labinator.com' },
{ label: 'Core C# Guide', href: 'https://csharp.labinator.com' },
{ label: 'Unity C# Guide', href: 'https://unity.labinator.com' },
{
label: 'GitHub',
href: 'https://github.com/LabinatorSolutions/csharp-cheatsheet',
},
],
},
],
copyright: `Copyright © ${new Date().getFullYear()} <a href="https://labinator.com" target="_blank" rel="noopener noreferrer">Labinator.com</a>`,
},
prism: {
theme: prismThemes.github,
darkTheme: prismThemes.github,
additionalLanguages: ['csharp', 'bash', 'json'],
},
}),
};
export default config;