boltdocs 1.3.0 → 1.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{cache-EHR7SXRU.mjs → cache-GQHF6BXI.mjs} +1 -1
- package/dist/{chunk-GSYECEZY.mjs → chunk-CYBWLFOG.mjs} +5 -1
- package/dist/node/index.js +36 -20
- package/dist/node/index.mjs +34 -22
- package/package.json +1 -1
- package/src/client/app/index.tsx +344 -344
- package/src/client/app/preload.tsx +56 -56
- package/src/client/index.ts +40 -40
- package/src/client/ssr.tsx +51 -51
- package/src/client/theme/components/CodeBlock/CodeBlock.tsx +76 -76
- package/src/client/theme/components/CodeBlock/index.ts +1 -1
- package/src/client/theme/components/PackageManagerTabs/PackageManagerTabs.tsx +154 -154
- package/src/client/theme/components/PackageManagerTabs/index.ts +1 -1
- package/src/client/theme/components/PackageManagerTabs/pkg-tabs.css +64 -64
- package/src/client/theme/components/Playground/Playground.tsx +124 -124
- package/src/client/theme/components/Playground/index.ts +1 -1
- package/src/client/theme/components/Playground/playground.css +168 -168
- package/src/client/theme/components/Video/Video.tsx +84 -84
- package/src/client/theme/components/Video/index.ts +1 -1
- package/src/client/theme/components/Video/video.css +41 -41
- package/src/client/theme/components/mdx/Admonition.tsx +80 -80
- package/src/client/theme/components/mdx/Badge.tsx +31 -31
- package/src/client/theme/components/mdx/Button.tsx +50 -50
- package/src/client/theme/components/mdx/Card.tsx +80 -80
- package/src/client/theme/components/mdx/List.tsx +57 -57
- package/src/client/theme/components/mdx/Tabs.tsx +94 -94
- package/src/client/theme/components/mdx/index.ts +18 -18
- package/src/client/theme/components/mdx/mdx-components.css +424 -424
- package/src/client/theme/icons/bun.tsx +62 -62
- package/src/client/theme/icons/deno.tsx +20 -20
- package/src/client/theme/icons/discord.tsx +12 -12
- package/src/client/theme/icons/github.tsx +15 -15
- package/src/client/theme/icons/npm.tsx +13 -13
- package/src/client/theme/icons/pnpm.tsx +72 -72
- package/src/client/theme/icons/twitter.tsx +12 -12
- package/src/client/theme/styles/markdown.css +343 -343
- package/src/client/theme/styles/variables.css +162 -162
- package/src/client/theme/styles.css +37 -37
- package/src/client/theme/ui/BackgroundGradient/BackgroundGradient.tsx +10 -10
- package/src/client/theme/ui/BackgroundGradient/index.ts +1 -1
- package/src/client/theme/ui/Breadcrumbs/Breadcrumbs.tsx +68 -68
- package/src/client/theme/ui/Breadcrumbs/index.ts +1 -1
- package/src/client/theme/ui/Footer/footer.css +32 -32
- package/src/client/theme/ui/Head/Head.tsx +69 -69
- package/src/client/theme/ui/Head/index.ts +1 -1
- package/src/client/theme/ui/LanguageSwitcher/LanguageSwitcher.tsx +125 -125
- package/src/client/theme/ui/LanguageSwitcher/index.ts +1 -1
- package/src/client/theme/ui/LanguageSwitcher/language-switcher.css +98 -98
- package/src/client/theme/ui/Layout/Layout.tsx +202 -202
- package/src/client/theme/ui/Layout/base.css +76 -76
- package/src/client/theme/ui/Layout/index.ts +2 -2
- package/src/client/theme/ui/Layout/pagination.css +72 -72
- package/src/client/theme/ui/Layout/responsive.css +36 -36
- package/src/client/theme/ui/Link/Link.tsx +254 -254
- package/src/client/theme/ui/Link/index.ts +2 -2
- package/src/client/theme/ui/Loading/Loading.tsx +10 -10
- package/src/client/theme/ui/Loading/index.ts +1 -1
- package/src/client/theme/ui/Loading/loading.css +30 -30
- package/src/client/theme/ui/Navbar/GithubStars.tsx +27 -27
- package/src/client/theme/ui/Navbar/Navbar.tsx +145 -145
- package/src/client/theme/ui/Navbar/index.ts +2 -2
- package/src/client/theme/ui/Navbar/navbar.css +233 -233
- package/src/client/theme/ui/NotFound/NotFound.tsx +19 -19
- package/src/client/theme/ui/NotFound/index.ts +1 -1
- package/src/client/theme/ui/NotFound/not-found.css +64 -64
- package/src/client/theme/ui/OnThisPage/OnThisPage.tsx +235 -235
- package/src/client/theme/ui/OnThisPage/index.ts +1 -1
- package/src/client/theme/ui/OnThisPage/toc.css +132 -132
- package/src/client/theme/ui/PoweredBy/PoweredBy.tsx +18 -18
- package/src/client/theme/ui/PoweredBy/index.ts +1 -1
- package/src/client/theme/ui/PoweredBy/powered-by.css +76 -76
- package/src/client/theme/ui/SearchDialog/SearchDialog.tsx +199 -199
- package/src/client/theme/ui/SearchDialog/index.ts +1 -1
- package/src/client/theme/ui/SearchDialog/search.css +152 -152
- package/src/client/theme/ui/Sidebar/Sidebar.tsx +204 -204
- package/src/client/theme/ui/Sidebar/index.ts +1 -1
- package/src/client/theme/ui/Sidebar/sidebar.css +236 -236
- package/src/client/theme/ui/ThemeToggle/ThemeToggle.tsx +69 -69
- package/src/client/theme/ui/ThemeToggle/index.ts +1 -1
- package/src/client/theme/ui/VersionSwitcher/VersionSwitcher.tsx +136 -136
- package/src/client/theme/ui/VersionSwitcher/index.ts +1 -1
- package/src/client/types.ts +50 -50
- package/src/client/utils.ts +26 -26
- package/src/node/cache.ts +408 -408
- package/src/node/config.ts +192 -192
- package/src/node/index.ts +21 -21
- package/src/node/mdx.ts +120 -120
- package/src/node/plugin/entry.ts +58 -58
- package/src/node/plugin/html.ts +55 -55
- package/src/node/plugin/index.ts +193 -193
- package/src/node/plugin/types.ts +11 -11
- package/src/node/routes/cache.ts +28 -28
- package/src/node/routes/index.ts +167 -167
- package/src/node/routes/parser.ts +153 -127
- package/src/node/routes/sorter.ts +42 -42
- package/src/node/routes/types.ts +49 -49
- package/src/node/ssg/index.ts +114 -114
- package/src/node/ssg/meta.ts +33 -34
- package/src/node/ssg/options.ts +13 -13
- package/src/node/ssg/sitemap.ts +55 -54
- package/src/node/utils.ts +145 -134
- package/tsconfig.json +20 -20
- package/tsup.config.ts +22 -22
|
@@ -1,202 +1,202 @@
|
|
|
1
|
-
import React, { useState } from "react";
|
|
2
|
-
import { useLocation } from "react-router-dom";
|
|
3
|
-
import { Link } from "../Link";
|
|
4
|
-
import { ChevronLeft, ChevronRight, Menu } from "lucide-react";
|
|
5
|
-
import { usePreload } from "../../../app/preload";
|
|
6
|
-
import { BoltdocsConfig } from "../../../../node/config";
|
|
7
|
-
import { ComponentRoute } from "../../../types";
|
|
8
|
-
export { Navbar } from "../Navbar";
|
|
9
|
-
export { Sidebar } from "../Sidebar";
|
|
10
|
-
export { OnThisPage } from "../OnThisPage";
|
|
11
|
-
export { Head } from "../Head";
|
|
12
|
-
export { Breadcrumbs } from "../Breadcrumbs";
|
|
13
|
-
export { BackgroundGradient } from "../BackgroundGradient";
|
|
14
|
-
|
|
15
|
-
import { Navbar } from "../Navbar";
|
|
16
|
-
import { Sidebar } from "../Sidebar";
|
|
17
|
-
import { OnThisPage } from "../OnThisPage";
|
|
18
|
-
import { Head } from "../Head";
|
|
19
|
-
import { Breadcrumbs } from "../Breadcrumbs";
|
|
20
|
-
import { BackgroundGradient } from "../BackgroundGradient";
|
|
21
|
-
import "../../styles.css";
|
|
22
|
-
|
|
23
|
-
export interface ThemeLayoutProps {
|
|
24
|
-
config: BoltdocsConfig;
|
|
25
|
-
routes: ComponentRoute[];
|
|
26
|
-
children: React.ReactNode;
|
|
27
|
-
/** Custom navbar component (slots) */
|
|
28
|
-
navbar?: React.ReactNode;
|
|
29
|
-
/** Custom sidebar component (slots) */
|
|
30
|
-
sidebar?: React.ReactNode;
|
|
31
|
-
/** Custom table of contents (OnThisPage) component (slots) */
|
|
32
|
-
toc?: React.ReactNode;
|
|
33
|
-
/** Custom background component (slots) */
|
|
34
|
-
background?: React.ReactNode;
|
|
35
|
-
/** Custom head/metadata component (slots) */
|
|
36
|
-
head?: React.ReactNode;
|
|
37
|
-
/** Custom breadcrumbs component (slots) */
|
|
38
|
-
breadcrumbs?: React.ReactNode;
|
|
39
|
-
/** Custom class name for the root layout element */
|
|
40
|
-
className?: string;
|
|
41
|
-
/** Custom styles for the root layout element */
|
|
42
|
-
style?: React.CSSProperties;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* The main structural layout for documentation pages.
|
|
47
|
-
* Integrates the Navbar, Sidebar, and OnThisPage components into a cohesive shell.
|
|
48
|
-
* It also manages mobile interaction states like the sidebar overlay toggle.
|
|
49
|
-
*
|
|
50
|
-
* @param config - The global Boltdocs configuration object
|
|
51
|
-
* @param routes - The array of available doc routes (used to render the sidebar)
|
|
52
|
-
*/
|
|
53
|
-
export function ThemeLayout({
|
|
54
|
-
config,
|
|
55
|
-
routes,
|
|
56
|
-
children,
|
|
57
|
-
navbar,
|
|
58
|
-
sidebar,
|
|
59
|
-
toc,
|
|
60
|
-
background,
|
|
61
|
-
head,
|
|
62
|
-
breadcrumbs,
|
|
63
|
-
className = "",
|
|
64
|
-
style,
|
|
65
|
-
}: ThemeLayoutProps) {
|
|
66
|
-
const [isSidebarOpen, setIsSidebarOpen] = useState(true);
|
|
67
|
-
const siteTitle = config.themeConfig?.title || "Boltdocs";
|
|
68
|
-
const siteDescription = config.themeConfig?.description || "";
|
|
69
|
-
const location = useLocation();
|
|
70
|
-
|
|
71
|
-
// Compute prev/next pages and locale
|
|
72
|
-
const currentIndex = routes.findIndex((r) => r.path === location.pathname);
|
|
73
|
-
const currentRoute = routes[currentIndex];
|
|
74
|
-
// Determine current locale (fallback to default)
|
|
75
|
-
const currentLocale = config.i18n
|
|
76
|
-
? currentRoute?.locale || config.i18n.defaultLocale
|
|
77
|
-
: undefined;
|
|
78
|
-
|
|
79
|
-
// Determine current version (fallback to default)
|
|
80
|
-
const currentVersion = config.versions
|
|
81
|
-
? currentRoute?.version || config.versions.defaultVersion
|
|
82
|
-
: undefined;
|
|
83
|
-
|
|
84
|
-
// Filter routes for sidebar, search, and navigation to only ones in the current locale and version
|
|
85
|
-
const filteredRoutes = routes.filter((r) => {
|
|
86
|
-
const localeMatch = config.i18n
|
|
87
|
-
? (r.locale || config.i18n.defaultLocale) === currentLocale
|
|
88
|
-
: true;
|
|
89
|
-
const versionMatch = config.versions
|
|
90
|
-
? (r.version || config.versions.defaultVersion) === currentVersion
|
|
91
|
-
: true;
|
|
92
|
-
return localeMatch && versionMatch;
|
|
93
|
-
});
|
|
94
|
-
|
|
95
|
-
const localIndex = filteredRoutes.findIndex(
|
|
96
|
-
(r) => r.path === location.pathname,
|
|
97
|
-
);
|
|
98
|
-
const prevPage = localIndex > 0 ? filteredRoutes[localIndex - 1] : null;
|
|
99
|
-
const nextPage =
|
|
100
|
-
localIndex >= 0 && localIndex < filteredRoutes.length - 1
|
|
101
|
-
? filteredRoutes[localIndex + 1]
|
|
102
|
-
: null;
|
|
103
|
-
|
|
104
|
-
const { preload } = usePreload();
|
|
105
|
-
React.useEffect(() => {
|
|
106
|
-
if (prevPage?.path) preload(prevPage.path);
|
|
107
|
-
if (nextPage?.path) preload(nextPage.path);
|
|
108
|
-
}, [prevPage, nextPage, preload]);
|
|
109
|
-
|
|
110
|
-
return (
|
|
111
|
-
<div className={`boltdocs-layout ${className}`} style={style}>
|
|
112
|
-
{background !== undefined ? background : <BackgroundGradient />}
|
|
113
|
-
{head !== undefined ? (
|
|
114
|
-
head
|
|
115
|
-
) : (
|
|
116
|
-
<Head
|
|
117
|
-
siteTitle={siteTitle}
|
|
118
|
-
siteDescription={siteDescription}
|
|
119
|
-
routes={routes}
|
|
120
|
-
/>
|
|
121
|
-
)}
|
|
122
|
-
{navbar !== undefined ? (
|
|
123
|
-
navbar
|
|
124
|
-
) : (
|
|
125
|
-
<Navbar
|
|
126
|
-
config={config}
|
|
127
|
-
routes={filteredRoutes}
|
|
128
|
-
allRoutes={routes}
|
|
129
|
-
currentLocale={currentLocale}
|
|
130
|
-
currentVersion={currentVersion}
|
|
131
|
-
/>
|
|
132
|
-
)}
|
|
133
|
-
<div
|
|
134
|
-
className={`boltdocs-main-container ${!isSidebarOpen ? "sidebar-collapsed" : ""}`}
|
|
135
|
-
>
|
|
136
|
-
{sidebar !== undefined ? (
|
|
137
|
-
sidebar
|
|
138
|
-
) : (
|
|
139
|
-
<Sidebar
|
|
140
|
-
routes={filteredRoutes}
|
|
141
|
-
config={config}
|
|
142
|
-
isCollapsed={!isSidebarOpen}
|
|
143
|
-
onToggle={() => setIsSidebarOpen(!isSidebarOpen)}
|
|
144
|
-
/>
|
|
145
|
-
)}
|
|
146
|
-
|
|
147
|
-
<main className="boltdocs-content">
|
|
148
|
-
{breadcrumbs !== undefined ? (
|
|
149
|
-
breadcrumbs
|
|
150
|
-
) : (
|
|
151
|
-
<Breadcrumbs routes={filteredRoutes} config={config} />
|
|
152
|
-
)}
|
|
153
|
-
<div className="boltdocs-page">{children}</div>
|
|
154
|
-
|
|
155
|
-
{/* Prev / Next Navigation */}
|
|
156
|
-
{(prevPage || nextPage) && (
|
|
157
|
-
<nav className="page-nav" aria-label="Pagination">
|
|
158
|
-
{prevPage ? (
|
|
159
|
-
<Link
|
|
160
|
-
to={prevPage.path || "/"}
|
|
161
|
-
className="page-nav-link page-nav-link--prev"
|
|
162
|
-
>
|
|
163
|
-
<div className="page-nav-info">
|
|
164
|
-
<span className="page-nav-label">Previous</span>
|
|
165
|
-
<span className="page-nav-title">{prevPage.title}</span>
|
|
166
|
-
</div>
|
|
167
|
-
<ChevronLeft className="page-nav-arrow" size={16} />
|
|
168
|
-
</Link>
|
|
169
|
-
) : (
|
|
170
|
-
<span />
|
|
171
|
-
)}
|
|
172
|
-
{nextPage ? (
|
|
173
|
-
<Link
|
|
174
|
-
to={nextPage.path || "/"}
|
|
175
|
-
className="page-nav-link page-nav-link--next"
|
|
176
|
-
>
|
|
177
|
-
<div className="page-nav-info">
|
|
178
|
-
<span className="page-nav-label">Next</span>
|
|
179
|
-
<span className="page-nav-title">{nextPage.title}</span>
|
|
180
|
-
</div>
|
|
181
|
-
<ChevronRight className="page-nav-arrow" size={16} />
|
|
182
|
-
</Link>
|
|
183
|
-
) : (
|
|
184
|
-
<span />
|
|
185
|
-
)}
|
|
186
|
-
</nav>
|
|
187
|
-
)}
|
|
188
|
-
</main>
|
|
189
|
-
{toc !== undefined ? (
|
|
190
|
-
toc
|
|
191
|
-
) : (
|
|
192
|
-
<OnThisPage
|
|
193
|
-
headings={routes[currentIndex]?.headings}
|
|
194
|
-
editLink={config.themeConfig?.editLink}
|
|
195
|
-
communityHelp={config.themeConfig?.communityHelp}
|
|
196
|
-
filePath={routes[currentIndex]?.filePath}
|
|
197
|
-
/>
|
|
198
|
-
)}
|
|
199
|
-
</div>
|
|
200
|
-
</div>
|
|
201
|
-
);
|
|
202
|
-
}
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
import { useLocation } from "react-router-dom";
|
|
3
|
+
import { Link } from "../Link";
|
|
4
|
+
import { ChevronLeft, ChevronRight, Menu } from "lucide-react";
|
|
5
|
+
import { usePreload } from "../../../app/preload";
|
|
6
|
+
import { BoltdocsConfig } from "../../../../node/config";
|
|
7
|
+
import { ComponentRoute } from "../../../types";
|
|
8
|
+
export { Navbar } from "../Navbar";
|
|
9
|
+
export { Sidebar } from "../Sidebar";
|
|
10
|
+
export { OnThisPage } from "../OnThisPage";
|
|
11
|
+
export { Head } from "../Head";
|
|
12
|
+
export { Breadcrumbs } from "../Breadcrumbs";
|
|
13
|
+
export { BackgroundGradient } from "../BackgroundGradient";
|
|
14
|
+
|
|
15
|
+
import { Navbar } from "../Navbar";
|
|
16
|
+
import { Sidebar } from "../Sidebar";
|
|
17
|
+
import { OnThisPage } from "../OnThisPage";
|
|
18
|
+
import { Head } from "../Head";
|
|
19
|
+
import { Breadcrumbs } from "../Breadcrumbs";
|
|
20
|
+
import { BackgroundGradient } from "../BackgroundGradient";
|
|
21
|
+
import "../../styles.css";
|
|
22
|
+
|
|
23
|
+
export interface ThemeLayoutProps {
|
|
24
|
+
config: BoltdocsConfig;
|
|
25
|
+
routes: ComponentRoute[];
|
|
26
|
+
children: React.ReactNode;
|
|
27
|
+
/** Custom navbar component (slots) */
|
|
28
|
+
navbar?: React.ReactNode;
|
|
29
|
+
/** Custom sidebar component (slots) */
|
|
30
|
+
sidebar?: React.ReactNode;
|
|
31
|
+
/** Custom table of contents (OnThisPage) component (slots) */
|
|
32
|
+
toc?: React.ReactNode;
|
|
33
|
+
/** Custom background component (slots) */
|
|
34
|
+
background?: React.ReactNode;
|
|
35
|
+
/** Custom head/metadata component (slots) */
|
|
36
|
+
head?: React.ReactNode;
|
|
37
|
+
/** Custom breadcrumbs component (slots) */
|
|
38
|
+
breadcrumbs?: React.ReactNode;
|
|
39
|
+
/** Custom class name for the root layout element */
|
|
40
|
+
className?: string;
|
|
41
|
+
/** Custom styles for the root layout element */
|
|
42
|
+
style?: React.CSSProperties;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* The main structural layout for documentation pages.
|
|
47
|
+
* Integrates the Navbar, Sidebar, and OnThisPage components into a cohesive shell.
|
|
48
|
+
* It also manages mobile interaction states like the sidebar overlay toggle.
|
|
49
|
+
*
|
|
50
|
+
* @param config - The global Boltdocs configuration object
|
|
51
|
+
* @param routes - The array of available doc routes (used to render the sidebar)
|
|
52
|
+
*/
|
|
53
|
+
export function ThemeLayout({
|
|
54
|
+
config,
|
|
55
|
+
routes,
|
|
56
|
+
children,
|
|
57
|
+
navbar,
|
|
58
|
+
sidebar,
|
|
59
|
+
toc,
|
|
60
|
+
background,
|
|
61
|
+
head,
|
|
62
|
+
breadcrumbs,
|
|
63
|
+
className = "",
|
|
64
|
+
style,
|
|
65
|
+
}: ThemeLayoutProps) {
|
|
66
|
+
const [isSidebarOpen, setIsSidebarOpen] = useState(true);
|
|
67
|
+
const siteTitle = config.themeConfig?.title || "Boltdocs";
|
|
68
|
+
const siteDescription = config.themeConfig?.description || "";
|
|
69
|
+
const location = useLocation();
|
|
70
|
+
|
|
71
|
+
// Compute prev/next pages and locale
|
|
72
|
+
const currentIndex = routes.findIndex((r) => r.path === location.pathname);
|
|
73
|
+
const currentRoute = routes[currentIndex];
|
|
74
|
+
// Determine current locale (fallback to default)
|
|
75
|
+
const currentLocale = config.i18n
|
|
76
|
+
? currentRoute?.locale || config.i18n.defaultLocale
|
|
77
|
+
: undefined;
|
|
78
|
+
|
|
79
|
+
// Determine current version (fallback to default)
|
|
80
|
+
const currentVersion = config.versions
|
|
81
|
+
? currentRoute?.version || config.versions.defaultVersion
|
|
82
|
+
: undefined;
|
|
83
|
+
|
|
84
|
+
// Filter routes for sidebar, search, and navigation to only ones in the current locale and version
|
|
85
|
+
const filteredRoutes = routes.filter((r) => {
|
|
86
|
+
const localeMatch = config.i18n
|
|
87
|
+
? (r.locale || config.i18n.defaultLocale) === currentLocale
|
|
88
|
+
: true;
|
|
89
|
+
const versionMatch = config.versions
|
|
90
|
+
? (r.version || config.versions.defaultVersion) === currentVersion
|
|
91
|
+
: true;
|
|
92
|
+
return localeMatch && versionMatch;
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
const localIndex = filteredRoutes.findIndex(
|
|
96
|
+
(r) => r.path === location.pathname,
|
|
97
|
+
);
|
|
98
|
+
const prevPage = localIndex > 0 ? filteredRoutes[localIndex - 1] : null;
|
|
99
|
+
const nextPage =
|
|
100
|
+
localIndex >= 0 && localIndex < filteredRoutes.length - 1
|
|
101
|
+
? filteredRoutes[localIndex + 1]
|
|
102
|
+
: null;
|
|
103
|
+
|
|
104
|
+
const { preload } = usePreload();
|
|
105
|
+
React.useEffect(() => {
|
|
106
|
+
if (prevPage?.path) preload(prevPage.path);
|
|
107
|
+
if (nextPage?.path) preload(nextPage.path);
|
|
108
|
+
}, [prevPage, nextPage, preload]);
|
|
109
|
+
|
|
110
|
+
return (
|
|
111
|
+
<div className={`boltdocs-layout ${className}`} style={style}>
|
|
112
|
+
{background !== undefined ? background : <BackgroundGradient />}
|
|
113
|
+
{head !== undefined ? (
|
|
114
|
+
head
|
|
115
|
+
) : (
|
|
116
|
+
<Head
|
|
117
|
+
siteTitle={siteTitle}
|
|
118
|
+
siteDescription={siteDescription}
|
|
119
|
+
routes={routes}
|
|
120
|
+
/>
|
|
121
|
+
)}
|
|
122
|
+
{navbar !== undefined ? (
|
|
123
|
+
navbar
|
|
124
|
+
) : (
|
|
125
|
+
<Navbar
|
|
126
|
+
config={config}
|
|
127
|
+
routes={filteredRoutes}
|
|
128
|
+
allRoutes={routes}
|
|
129
|
+
currentLocale={currentLocale}
|
|
130
|
+
currentVersion={currentVersion}
|
|
131
|
+
/>
|
|
132
|
+
)}
|
|
133
|
+
<div
|
|
134
|
+
className={`boltdocs-main-container ${!isSidebarOpen ? "sidebar-collapsed" : ""}`}
|
|
135
|
+
>
|
|
136
|
+
{sidebar !== undefined ? (
|
|
137
|
+
sidebar
|
|
138
|
+
) : (
|
|
139
|
+
<Sidebar
|
|
140
|
+
routes={filteredRoutes}
|
|
141
|
+
config={config}
|
|
142
|
+
isCollapsed={!isSidebarOpen}
|
|
143
|
+
onToggle={() => setIsSidebarOpen(!isSidebarOpen)}
|
|
144
|
+
/>
|
|
145
|
+
)}
|
|
146
|
+
|
|
147
|
+
<main className="boltdocs-content">
|
|
148
|
+
{breadcrumbs !== undefined ? (
|
|
149
|
+
breadcrumbs
|
|
150
|
+
) : (
|
|
151
|
+
<Breadcrumbs routes={filteredRoutes} config={config} />
|
|
152
|
+
)}
|
|
153
|
+
<div className="boltdocs-page">{children}</div>
|
|
154
|
+
|
|
155
|
+
{/* Prev / Next Navigation */}
|
|
156
|
+
{(prevPage || nextPage) && (
|
|
157
|
+
<nav className="page-nav" aria-label="Pagination">
|
|
158
|
+
{prevPage ? (
|
|
159
|
+
<Link
|
|
160
|
+
to={prevPage.path || "/"}
|
|
161
|
+
className="page-nav-link page-nav-link--prev"
|
|
162
|
+
>
|
|
163
|
+
<div className="page-nav-info">
|
|
164
|
+
<span className="page-nav-label">Previous</span>
|
|
165
|
+
<span className="page-nav-title">{prevPage.title}</span>
|
|
166
|
+
</div>
|
|
167
|
+
<ChevronLeft className="page-nav-arrow" size={16} />
|
|
168
|
+
</Link>
|
|
169
|
+
) : (
|
|
170
|
+
<span />
|
|
171
|
+
)}
|
|
172
|
+
{nextPage ? (
|
|
173
|
+
<Link
|
|
174
|
+
to={nextPage.path || "/"}
|
|
175
|
+
className="page-nav-link page-nav-link--next"
|
|
176
|
+
>
|
|
177
|
+
<div className="page-nav-info">
|
|
178
|
+
<span className="page-nav-label">Next</span>
|
|
179
|
+
<span className="page-nav-title">{nextPage.title}</span>
|
|
180
|
+
</div>
|
|
181
|
+
<ChevronRight className="page-nav-arrow" size={16} />
|
|
182
|
+
</Link>
|
|
183
|
+
) : (
|
|
184
|
+
<span />
|
|
185
|
+
)}
|
|
186
|
+
</nav>
|
|
187
|
+
)}
|
|
188
|
+
</main>
|
|
189
|
+
{toc !== undefined ? (
|
|
190
|
+
toc
|
|
191
|
+
) : (
|
|
192
|
+
<OnThisPage
|
|
193
|
+
headings={routes[currentIndex]?.headings}
|
|
194
|
+
editLink={config.themeConfig?.editLink}
|
|
195
|
+
communityHelp={config.themeConfig?.communityHelp}
|
|
196
|
+
filePath={routes[currentIndex]?.filePath}
|
|
197
|
+
/>
|
|
198
|
+
)}
|
|
199
|
+
</div>
|
|
200
|
+
</div>
|
|
201
|
+
);
|
|
202
|
+
}
|
|
@@ -1,76 +1,76 @@
|
|
|
1
|
-
/* ─── Reset ──────────────────────────────────────────────── */
|
|
2
|
-
*,
|
|
3
|
-
*::before,
|
|
4
|
-
*::after {
|
|
5
|
-
box-sizing: border-box;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
body {
|
|
9
|
-
margin: 0;
|
|
10
|
-
font-family: var(--ld-font-sans);
|
|
11
|
-
background-color: var(--ld-bg-main);
|
|
12
|
-
color: var(--ld-text-main);
|
|
13
|
-
line-height: 1.7;
|
|
14
|
-
-webkit-font-smoothing: antialiased;
|
|
15
|
-
-moz-osx-font-smoothing: grayscale;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
a {
|
|
19
|
-
text-decoration: none;
|
|
20
|
-
|
|
21
|
-
&:hover {
|
|
22
|
-
text-decoration: none;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
/* ─── Layout Shell ───────────────────────────────────────── */
|
|
27
|
-
.boltdocs-layout {
|
|
28
|
-
display: flex;
|
|
29
|
-
flex-direction: column;
|
|
30
|
-
min-height: 100vh;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.boltdocs-main-container {
|
|
34
|
-
display: flex;
|
|
35
|
-
flex: 1;
|
|
36
|
-
width: 100%;
|
|
37
|
-
max-width: 1440px;
|
|
38
|
-
margin: 0 auto;
|
|
39
|
-
padding: 0 1.5rem;
|
|
40
|
-
/* aligns with navbar */
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
/* ─── Background Glow ────────────────────────────────────── */
|
|
44
|
-
.boltdocs-background-glow {
|
|
45
|
-
position: fixed;
|
|
46
|
-
top: 0;
|
|
47
|
-
left: 0;
|
|
48
|
-
right: 0;
|
|
49
|
-
height: 100vh;
|
|
50
|
-
overflow: hidden;
|
|
51
|
-
z-index: -1;
|
|
52
|
-
pointer-events: none;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
.glow-shape {
|
|
56
|
-
position: absolute;
|
|
57
|
-
border-radius: 50%;
|
|
58
|
-
filter: blur(100px);
|
|
59
|
-
opacity: 0.15;
|
|
60
|
-
top: -100px;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
.glow-1 {
|
|
64
|
-
width: 600px;
|
|
65
|
-
height: 600px;
|
|
66
|
-
background: var(--ld-glow-1-bg);
|
|
67
|
-
left: -200px;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
.glow-2 {
|
|
71
|
-
width: 800px;
|
|
72
|
-
height: 800px;
|
|
73
|
-
background: var(--ld-glow-2-bg);
|
|
74
|
-
right: -300px;
|
|
75
|
-
top: -200px;
|
|
76
|
-
}
|
|
1
|
+
/* ─── Reset ──────────────────────────────────────────────── */
|
|
2
|
+
*,
|
|
3
|
+
*::before,
|
|
4
|
+
*::after {
|
|
5
|
+
box-sizing: border-box;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
body {
|
|
9
|
+
margin: 0;
|
|
10
|
+
font-family: var(--ld-font-sans);
|
|
11
|
+
background-color: var(--ld-bg-main);
|
|
12
|
+
color: var(--ld-text-main);
|
|
13
|
+
line-height: 1.7;
|
|
14
|
+
-webkit-font-smoothing: antialiased;
|
|
15
|
+
-moz-osx-font-smoothing: grayscale;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
a {
|
|
19
|
+
text-decoration: none;
|
|
20
|
+
|
|
21
|
+
&:hover {
|
|
22
|
+
text-decoration: none;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/* ─── Layout Shell ───────────────────────────────────────── */
|
|
27
|
+
.boltdocs-layout {
|
|
28
|
+
display: flex;
|
|
29
|
+
flex-direction: column;
|
|
30
|
+
min-height: 100vh;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.boltdocs-main-container {
|
|
34
|
+
display: flex;
|
|
35
|
+
flex: 1;
|
|
36
|
+
width: 100%;
|
|
37
|
+
max-width: 1440px;
|
|
38
|
+
margin: 0 auto;
|
|
39
|
+
padding: 0 1.5rem;
|
|
40
|
+
/* aligns with navbar */
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/* ─── Background Glow ────────────────────────────────────── */
|
|
44
|
+
.boltdocs-background-glow {
|
|
45
|
+
position: fixed;
|
|
46
|
+
top: 0;
|
|
47
|
+
left: 0;
|
|
48
|
+
right: 0;
|
|
49
|
+
height: 100vh;
|
|
50
|
+
overflow: hidden;
|
|
51
|
+
z-index: -1;
|
|
52
|
+
pointer-events: none;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.glow-shape {
|
|
56
|
+
position: absolute;
|
|
57
|
+
border-radius: 50%;
|
|
58
|
+
filter: blur(100px);
|
|
59
|
+
opacity: 0.15;
|
|
60
|
+
top: -100px;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.glow-1 {
|
|
64
|
+
width: 600px;
|
|
65
|
+
height: 600px;
|
|
66
|
+
background: var(--ld-glow-1-bg);
|
|
67
|
+
left: -200px;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.glow-2 {
|
|
71
|
+
width: 800px;
|
|
72
|
+
height: 800px;
|
|
73
|
+
background: var(--ld-glow-2-bg);
|
|
74
|
+
right: -300px;
|
|
75
|
+
top: -200px;
|
|
76
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { ThemeLayout } from "./Layout";
|
|
2
|
-
export type { ThemeLayoutProps } from "./Layout";
|
|
1
|
+
export { ThemeLayout } from "./Layout";
|
|
2
|
+
export type { ThemeLayoutProps } from "./Layout";
|