-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocusaurus.config.js
More file actions
243 lines (226 loc) · 6.23 KB
/
docusaurus.config.js
File metadata and controls
243 lines (226 loc) · 6.23 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
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
// @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");
/** @type {import('@docusaurus/types').Config} */
const config = {
title: "SleakOps Documentation",
tagline: "SleakOps Documentation",
url: "https://docs.sleakops.com",
baseUrl: process.env.BASE_URL || "/",
onBrokenLinks: "throw",
favicon: "img/favicon.ico",
markdown: {
mermaid: true,
hooks: {
onBrokenMarkdownLinks: "warn",
},
},
organizationName: "Craftech",
projectName: "Sleakops",
deploymentBranch: "gh-pages",
trailingSlash: false,
i18n: {
defaultLocale: "en",
locales: ["en", "es"],
path: "i18n",
localeConfigs: {
en: {
htmlLang: "en",
label: "English",
},
es: {
htmlLang: "es",
label: "Español",
},
},
},
// Eliminamos el tema easyops-cn/docusaurus-search-local
themes: ["@docusaurus/theme-mermaid"],
presets: [
[
"classic",
{
debug: false,
theme: {
customCss: [require.resolve("./src/css/custom.css")],
},
docs: {
sidebarPath: require.resolve("./sidebars.js"),
routeBasePath: "/docs",
sidebarCollapsible: true,
sidebarCollapsed: true,
editUrl: (/** @type {{ docPath: string }} */ { docPath }) => {
// Map document paths to their corresponding CMS collections
// docPath format: "cluster/addons/example.mdx" or "index.mdx"
// Remove the file extension to get the slug
const slug = docPath.replace(/\.mdx?$/, "");
// Extract the path segments
const pathSegments = docPath.split("/");
// Determine the collection based on the path structure
let collection = "docs-root"; // Default for root-level files
if (pathSegments.length >= 2) {
const firstSegment = pathSegments[0];
const secondSegment = pathSegments[1];
// Check for nested collections (e.g., cluster/addons, project/build)
if (
pathSegments.length >= 3 &&
secondSegment !== pathSegments[pathSegments.length - 1]
) {
collection = `docs-${firstSegment}-${secondSegment}`;
} else {
// Single-level collections (e.g., cluster, domain, environment)
collection = `docs-${firstSegment}`;
}
}
// Build the complete CMS URL with /entries/ and the slug
return `https://docs.sleakops.com/preview-docs/admin/#/collections/${collection}/entries/${slug}`;
},
},
blog: {},
pages: {
routeBasePath: "/",
},
sitemap: {
changefreq: "weekly",
priority: 0.5,
ignorePatterns: ["/tags/**"],
filename: "sitemap.xml",
},
googleAnalytics: {
trackingID: "UA-128497858-1",
anonymizeIP: true,
},
},
],
],
// Configuración del plugin docusaurus-lunr-search
plugins: [
[
require.resolve("docusaurus-lunr-search"),
{
languages: ["en", "es"],
indexBaseUrl: true,
},
],
[
"@docusaurus/plugin-content-blog",
{
id: "changelog",
routeBasePath: "changelog",
path: "./changelog",
blogTitle: "Changelog",
blogDescription: "SleakOps Changelog - Latest updates and releases",
blogSidebarTitle: "Recent Updates",
blogSidebarCount: "ALL",
showReadingTime: false,
postsPerPage: 10,
sortPosts: "descending",
editUrl:
"https://docs.sleakops.com/preview-docs/admin/#/collections/changelog",
},
],
[
"@docusaurus/plugin-content-docs",
{
id: "tutorials",
path: "tutorials",
routeBasePath: "tutorial",
sidebarPath: require.resolve("./sidebars-tutorials.js"),
editUrl:
"https://docs.sleakops.com/preview-docs/admin/#/collections/tutorials",
},
],
],
themeConfig: {
colorMode: {
defaultMode: "dark",
disableSwitch: false,
respectPrefersColorScheme: false,
},
navbar: {
title: "SleakOps",
logo: {
alt: "SleakOps2",
src: "img/logo2.svg",
},
items: [
{
label: "Home",
to: "/",
position: "left",
activeBaseRegex: "^/$",
},
{
label: "Docs",
to: "/docs",
position: "left",
},
{
label: "Tutorials",
to: "/tutorials",
position: "left",
},
{
label: "Changelog",
to: "/changelog",
position: "left",
},
{
href: "https://console.sleakops.com",
label: "Console",
position: "right",
},
{
href: "https://sleakops.com/blog/",
label: "Blog",
position: "right",
},
{
type: "localeDropdown",
position: "right",
},
],
},
footer: {
links: [
{
title: "Docs",
items: [
{
label: "Tutorial",
to: "/tutorials",
},
{
label: "About us",
href: "https://sleakops.com/",
},
{
label: "Contact us",
href: "https://sleakops.com/contact",
},
],
},
{
title: "More",
items: [
{
label: "Terms & Conditions",
href: "https://craftech.notion.site/Terms-Conditions-efb8d9a980654625af456732ed44b197",
},
{
label: "Privacy Policy",
href: "https://craftech.notion.site/Privacy-Policy-of-SleakOps-55b977da50d84871809879d065b16b3b",
},
],
},
],
copyright: `Copyright © ${new Date().getFullYear()} SleakOps.`,
},
prism: {
theme: lightCodeTheme,
darkTheme: darkCodeTheme,
},
},
};
module.exports = config;