@writedocs/generator 0.10.19 → 0.11.0
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/astro.config.mjs +32 -8
- package/package.json +96 -93
- package/src/cli/base-path-layout.js +44 -0
- package/src/cli/build.js +177 -168
- package/src/cli/check-built-styles.js +41 -33
- package/src/cli/dev.js +261 -244
- package/src/cli/generate-api-pages.js +9 -5
- package/src/cli/page-list-watch.js +69 -66
- package/src/cli/run-pagefind.js +154 -148
- package/src/cli/write-mcp-files.js +103 -96
- package/src/cli/write-redirects-file.js +25 -8
- package/src/components/AppIcon.astro +51 -50
- package/src/components/Card.astro +193 -192
- package/src/components/CopyPageMenu.astro +374 -370
- package/src/components/Hint.astro +188 -187
- package/src/components/Icon.astro +72 -71
- package/src/components/Image.astro +165 -164
- package/src/components/Tile.astro +67 -66
- package/src/components/Video.astro +137 -136
- package/src/layout/BaseLayout.astro +21 -12
- package/src/layout/components/AnalyticsScripts.astro +6 -2
- package/src/layout/components/Breadcrumbs.astro +98 -97
- package/src/layout/components/ConsentBanner.astro +119 -118
- package/src/layout/components/MobileMenu.astro +229 -228
- package/src/layout/components/NavTree.astro +393 -392
- package/src/layout/components/Sidebar.astro +232 -231
- package/src/layout/components/SiteFooter.astro +87 -86
- package/src/layout/components/TopBar.astro +386 -385
- package/src/lib/agent-markdown.js +164 -162
- package/src/lib/asset-dimensions.js +89 -0
- package/src/lib/base-path.js +90 -0
- package/src/lib/config-schema.js +10 -0
- package/src/lib/config-schema.ts +17 -0
- package/src/lib/config.ts +1314 -1289
- package/src/lib/consent.js +108 -102
- package/src/lib/image-size.js +152 -140
- package/src/lib/json-schema-descriptions.js +1 -0
- package/src/lib/link-check.js +42 -4
- package/src/lib/llms-index.ts +90 -88
- package/src/lib/mcp-dev-integration.js +65 -60
- package/src/lib/mcp-index.ts +102 -101
- package/src/lib/pages.js +312 -304
- package/src/lib/project-files-integration.js +116 -61
- package/src/lib/project-files.js +137 -126
- package/src/lib/project-ignore.js +46 -0
- package/src/lib/rehype-base-path.js +62 -0
- package/src/lib/rehype-image-loading.js +71 -71
- package/src/lib/robots-txt.js +21 -16
- package/src/lib/seo-tags.js +155 -140
- package/src/lib/site-base.ts +27 -0
- package/src/lib/styles-asset-integration.js +58 -12
- package/src/lib/wdignore-cases.json +195 -0
- package/src/lib/wdignore.js +177 -0
- package/src/pages/404.astro +63 -62
- package/src/pages/[...slug].astro +1604 -1597
- package/src/pages/[...slug].md.ts +93 -93
- package/src/pages/llms-full.txt.ts +88 -86
- package/src/scripts/search.ts +241 -237
- package/writedocs.schema.json +6 -0
|
@@ -1,228 +1,229 @@
|
|
|
1
|
-
---
|
|
2
|
-
// The <= 860px overlay drawer that TopBar.astro's own hamburger button
|
|
3
|
-
// opens - everything that's a side-by-side control on desktop (the
|
|
4
|
-
// brand-row switchers, the tabs bar, the always-visible global dropdowns)
|
|
5
|
-
// plus the sidebar itself collapses into this one panel below 860px.
|
|
6
|
-
// Reuses the exact same `selectors`/`globalDropdowns` props TopBar.astro
|
|
7
|
-
// renders its own desktop switchers/tabs from (see its own
|
|
8
|
-
// switcherSelectors/tabSelectors) rather than a filtered subset - unlike
|
|
9
|
-
// TopBar's switcherSelectors (which deliberately *drops* a dropdown
|
|
10
|
-
// selector nested directly under a tab, since desktop folds it into that
|
|
11
|
-
// tab's own dropdown-trigger button), this renders every entry of
|
|
12
|
-
// `selectors` in root-to-leaf order as its own accordion row. That's what
|
|
13
|
-
// makes "a tab with its own dropdowns gets a second selector right below
|
|
14
|
-
// it" fall out for free: when the active page is under such a tab,
|
|
15
|
-
// `selectors` already contains that nested dropdown as its own array
|
|
16
|
-
// entry immediately following the tab's entry (see buildSelectors() in
|
|
17
|
-
// lib/config.ts, which walks the active PathSegment[] in that exact
|
|
18
|
-
// order) - no tab-specific branching needed here at all.
|
|
19
|
-
//
|
|
20
|
-
// The sidebar itself is the `sidebar` slot, forwarded straight through
|
|
21
|
-
// from whatever BaseLayout.astro received - rendered a second time
|
|
22
|
-
// (Astro renders the same passed-in slot content at every place it's
|
|
23
|
-
// referenced, not just once); the first copy is in BaseLayout's own
|
|
24
|
-
// `.wd-sidebar-col`, for desktop. Both copies exist in the DOM on every
|
|
25
|
-
// load; only one is ever visible at a time (mobile-menu.css hides this
|
|
26
|
-
// whole panel above 860px, base.css hides .wd-sidebar-col at/below it),
|
|
27
|
-
// so there's no duplicate-content flash either way.
|
|
28
|
-
//
|
|
29
|
-
// Split out of BaseLayout.astro, which had grown to ~2200 lines covering
|
|
30
|
-
// several unrelated concerns in one file - see that component's own
|
|
31
|
-
// comment for the fuller rationale.
|
|
32
|
-
import { isExternalHref, type DocsConfig, type Selector, type GlobalDropdownView } from '../../lib/config';
|
|
33
|
-
import AppIcon from '../../components/AppIcon.astro';
|
|
34
|
-
import { logoWidth } from '../../lib/image-size.js';
|
|
35
|
-
import { hasMobileMenu, currentOption } from '../../lib/selector-placement.js';
|
|
36
|
-
import '../styles/dropdown.css';
|
|
37
|
-
import '../styles/topbar.css';
|
|
38
|
-
import '../styles/mobile-menu.css';
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
//
|
|
46
|
-
//
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
//
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
<div class="wd-mobile-menu-
|
|
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
|
-
<AppIcon icon="
|
|
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
|
-
{opt.
|
|
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
|
-
{item.
|
|
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
|
-
import {
|
|
212
|
-
|
|
213
|
-
//
|
|
214
|
-
//
|
|
215
|
-
//
|
|
216
|
-
//
|
|
217
|
-
//
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
document
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
1
|
+
---
|
|
2
|
+
// The <= 860px overlay drawer that TopBar.astro's own hamburger button
|
|
3
|
+
// opens - everything that's a side-by-side control on desktop (the
|
|
4
|
+
// brand-row switchers, the tabs bar, the always-visible global dropdowns)
|
|
5
|
+
// plus the sidebar itself collapses into this one panel below 860px.
|
|
6
|
+
// Reuses the exact same `selectors`/`globalDropdowns` props TopBar.astro
|
|
7
|
+
// renders its own desktop switchers/tabs from (see its own
|
|
8
|
+
// switcherSelectors/tabSelectors) rather than a filtered subset - unlike
|
|
9
|
+
// TopBar's switcherSelectors (which deliberately *drops* a dropdown
|
|
10
|
+
// selector nested directly under a tab, since desktop folds it into that
|
|
11
|
+
// tab's own dropdown-trigger button), this renders every entry of
|
|
12
|
+
// `selectors` in root-to-leaf order as its own accordion row. That's what
|
|
13
|
+
// makes "a tab with its own dropdowns gets a second selector right below
|
|
14
|
+
// it" fall out for free: when the active page is under such a tab,
|
|
15
|
+
// `selectors` already contains that nested dropdown as its own array
|
|
16
|
+
// entry immediately following the tab's entry (see buildSelectors() in
|
|
17
|
+
// lib/config.ts, which walks the active PathSegment[] in that exact
|
|
18
|
+
// order) - no tab-specific branching needed here at all.
|
|
19
|
+
//
|
|
20
|
+
// The sidebar itself is the `sidebar` slot, forwarded straight through
|
|
21
|
+
// from whatever BaseLayout.astro received - rendered a second time
|
|
22
|
+
// (Astro renders the same passed-in slot content at every place it's
|
|
23
|
+
// referenced, not just once); the first copy is in BaseLayout's own
|
|
24
|
+
// `.wd-sidebar-col`, for desktop. Both copies exist in the DOM on every
|
|
25
|
+
// load; only one is ever visible at a time (mobile-menu.css hides this
|
|
26
|
+
// whole panel above 860px, base.css hides .wd-sidebar-col at/below it),
|
|
27
|
+
// so there's no duplicate-content flash either way.
|
|
28
|
+
//
|
|
29
|
+
// Split out of BaseLayout.astro, which had grown to ~2200 lines covering
|
|
30
|
+
// several unrelated concerns in one file - see that component's own
|
|
31
|
+
// comment for the fuller rationale.
|
|
32
|
+
import { isExternalHref, type DocsConfig, type Selector, type GlobalDropdownView } from '../../lib/config';
|
|
33
|
+
import AppIcon from '../../components/AppIcon.astro';
|
|
34
|
+
import { logoWidth } from '../../lib/image-size.js';
|
|
35
|
+
import { hasMobileMenu, currentOption } from '../../lib/selector-placement.js';
|
|
36
|
+
import '../styles/dropdown.css';
|
|
37
|
+
import '../styles/topbar.css';
|
|
38
|
+
import '../styles/mobile-menu.css';
|
|
39
|
+
import { siteHref } from '../../lib/site-base';
|
|
40
|
+
|
|
41
|
+
interface Props {
|
|
42
|
+
config: DocsConfig;
|
|
43
|
+
selectors: Selector[];
|
|
44
|
+
globalDropdowns: GlobalDropdownView[];
|
|
45
|
+
// Whether this page would show a sidebar at all (mode === 'default' or
|
|
46
|
+
// 'wide') - this whole component renders nothing otherwise, same
|
|
47
|
+
// condition TopBar.astro gates its own hamburger toggle on.
|
|
48
|
+
showSidebarCol: boolean;
|
|
49
|
+
logoLight?: string;
|
|
50
|
+
logoDark?: string;
|
|
51
|
+
brandLabel?: string;
|
|
52
|
+
}
|
|
53
|
+
const { config, selectors, globalDropdowns, showSidebarCol, logoLight, logoDark, brandLabel } = Astro.props as Props;
|
|
54
|
+
// A page without a sidebar (`mode: custom`) still gets the menu when it has
|
|
55
|
+
// tabs, switchers or global dropdowns to reach - just without the sidebar part.
|
|
56
|
+
const showMenu = hasMobileMenu({ sidebar: showSidebarCol, selectors, globalDropdowns });
|
|
57
|
+
---
|
|
58
|
+
{showMenu && (
|
|
59
|
+
<div class="wd-mobile-menu" id="wd-mobile-menu" inert>
|
|
60
|
+
<div class="wd-mobile-menu-backdrop" data-mobile-menu-backdrop></div>
|
|
61
|
+
<div class="wd-mobile-menu-panel" role="dialog" aria-modal="true" aria-label="Navigation">
|
|
62
|
+
{/* The panel reaches all the way to the top of the viewport (see
|
|
63
|
+
mobile-menu.css) rather than stopping below the real topbar -
|
|
64
|
+
the real topbar's own height varies (one row, or two once
|
|
65
|
+
tabs/global dropdowns/a wrapped search box are involved), which
|
|
66
|
+
made lining this panel up under it a fragile approximation.
|
|
67
|
+
Instead this header replicates the topbar's own brand/close/
|
|
68
|
+
theme row *inside* the panel, at a fixed height the panel fully
|
|
69
|
+
controls, so it reads as "the same navbar" occupying the same
|
|
70
|
+
spot rather than a separate floating piece underneath one of
|
|
71
|
+
variable size. The real topbar is still there underneath, just
|
|
72
|
+
no longer relied on for anything while the menu is open - it's
|
|
73
|
+
covered by this panel's own opaque background (or dimmed by the
|
|
74
|
+
backdrop, past the panel's own width). */}
|
|
75
|
+
<div class="wd-mobile-menu-header">
|
|
76
|
+
<button
|
|
77
|
+
type="button"
|
|
78
|
+
class="wd-mobile-menu-close"
|
|
79
|
+
aria-label="Close menu"
|
|
80
|
+
data-mobile-menu-close
|
|
81
|
+
>
|
|
82
|
+
<svg width="18" height="18" viewBox="0 0 18 18" aria-hidden="true">
|
|
83
|
+
<path d="M4 4L14 14M14 4L4 14" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" />
|
|
84
|
+
</svg>
|
|
85
|
+
</button>
|
|
86
|
+
<a class="wd-topbar-brand" href={siteHref("/")}>
|
|
87
|
+
{logoLight && <img src={siteHref(logoLight)} alt={config.name} height="24" width={logoWidth(logoLight)} class="wd-logo-light" />}
|
|
88
|
+
{logoDark && <img src={siteHref(logoDark)} alt={config.name} height="24" width={logoWidth(logoDark)} class="wd-logo-dark" />}
|
|
89
|
+
{brandLabel && <span>{brandLabel}</span>}
|
|
90
|
+
</a>
|
|
91
|
+
{/* Same class as the real topbar's own theme button -
|
|
92
|
+
initThemeToggle() (src/scripts/theme-toggle.ts, wired below)
|
|
93
|
+
wires up every `.wd-theme-toggle` it finds (not just the
|
|
94
|
+
first), and both stay in sync for free since [data-theme] on
|
|
95
|
+
<html> - not per-button JS state - is what actually drives
|
|
96
|
+
which icon shows. */}
|
|
97
|
+
<button type="button" class="wd-theme-toggle" aria-label="Toggle color theme">
|
|
98
|
+
<AppIcon icon="sun" class="wd-theme-icon wd-theme-icon-sun" />
|
|
99
|
+
<AppIcon icon="moon" class="wd-theme-icon wd-theme-icon-moon" />
|
|
100
|
+
</button>
|
|
101
|
+
</div>
|
|
102
|
+
<div class="wd-mobile-menu-scroll">
|
|
103
|
+
{(selectors.some((sel) => !sel.hidden) || globalDropdowns.length > 0) && (
|
|
104
|
+
<div class="wd-mobile-menu-selectors">
|
|
105
|
+
{selectors.filter((sel) => !sel.hidden).map((sel) => {
|
|
106
|
+
// The level under an item whose own page this is, with nothing
|
|
107
|
+
// chosen yet (landingSelectors() in lib/config.ts): its options
|
|
108
|
+
// as an open list - a closed one would repeat the item's name,
|
|
109
|
+
// already on the level above.
|
|
110
|
+
if (sel.placeholder && !sel.options.some((opt) => opt.active)) {
|
|
111
|
+
return (
|
|
112
|
+
<nav class="wd-mobile-menu-choices" aria-label={sel.placeholder.label}>
|
|
113
|
+
{sel.options.map((opt) => (
|
|
114
|
+
<a
|
|
115
|
+
href={siteHref(opt.href)}
|
|
116
|
+
target={isExternalHref(opt.href) ? '_blank' : undefined}
|
|
117
|
+
rel={isExternalHref(opt.href) ? 'noopener noreferrer' : undefined}
|
|
118
|
+
>
|
|
119
|
+
<AppIcon icon={opt.icon} class="wd-tab-icon" />
|
|
120
|
+
<span class="wd-mobile-accordion-option-label">{opt.label}</span>
|
|
121
|
+
{opt.tag && <span class="wd-selector-tag">{opt.tag}</span>}
|
|
122
|
+
</a>
|
|
123
|
+
))}
|
|
124
|
+
</nav>
|
|
125
|
+
);
|
|
126
|
+
}
|
|
127
|
+
const current = currentOption(sel);
|
|
128
|
+
return (
|
|
129
|
+
<details class="wd-mobile-accordion" name="wd-mobile-accordion">
|
|
130
|
+
<summary class="wd-mobile-accordion-trigger">
|
|
131
|
+
<AppIcon icon={current.icon} class="wd-tab-icon" />
|
|
132
|
+
<span class="wd-mobile-accordion-label">{current.label}</span>
|
|
133
|
+
{current.tag && <span class="wd-selector-tag">{current.tag}</span>}
|
|
134
|
+
<svg class="wd-mobile-accordion-caret" width="12" height="12" viewBox="0 0 10 10" aria-hidden="true">
|
|
135
|
+
<path d="M2 3.5L5 6.5L8 3.5" stroke="currentColor" stroke-width="1.4" fill="none" stroke-linecap="round" stroke-linejoin="round" />
|
|
136
|
+
</svg>
|
|
137
|
+
</summary>
|
|
138
|
+
<div class="wd-mobile-accordion-options">
|
|
139
|
+
<div class="wd-mobile-accordion-options-panel">
|
|
140
|
+
{sel.options.map((opt) => (
|
|
141
|
+
<a
|
|
142
|
+
href={siteHref(opt.href)}
|
|
143
|
+
class={opt.active ? 'active' : ''}
|
|
144
|
+
target={isExternalHref(opt.href) ? '_blank' : undefined}
|
|
145
|
+
rel={isExternalHref(opt.href) ? 'noopener noreferrer' : undefined}
|
|
146
|
+
>
|
|
147
|
+
<AppIcon icon={opt.icon} class="wd-tab-icon" />
|
|
148
|
+
<span class="wd-mobile-accordion-option-label">{opt.label}</span>
|
|
149
|
+
{opt.tag && <span class="wd-selector-tag">{opt.tag}</span>}
|
|
150
|
+
{opt.active && (
|
|
151
|
+
<svg class="wd-mobile-accordion-check" width="14" height="14" viewBox="0 0 14 14" aria-hidden="true">
|
|
152
|
+
<path d="M3 7.5L6 10.5L11 4.5" stroke="currentColor" stroke-width="1.6" fill="none" stroke-linecap="round" stroke-linejoin="round" />
|
|
153
|
+
</svg>
|
|
154
|
+
)}
|
|
155
|
+
</a>
|
|
156
|
+
))}
|
|
157
|
+
</div>
|
|
158
|
+
</div>
|
|
159
|
+
</details>
|
|
160
|
+
);
|
|
161
|
+
})}
|
|
162
|
+
{globalDropdowns.map((d) =>
|
|
163
|
+
d.href !== null ? (
|
|
164
|
+
<a
|
|
165
|
+
href={siteHref(d.href)}
|
|
166
|
+
class="wd-mobile-menu-link"
|
|
167
|
+
target={isExternalHref(d.href) ? '_blank' : undefined}
|
|
168
|
+
rel={isExternalHref(d.href) ? 'noopener noreferrer' : undefined}
|
|
169
|
+
>
|
|
170
|
+
<AppIcon icon={d.icon} class="wd-tab-icon" />
|
|
171
|
+
<span class="wd-mobile-accordion-option-label">{d.label}</span>
|
|
172
|
+
</a>
|
|
173
|
+
) : (
|
|
174
|
+
<details class="wd-mobile-accordion" name="wd-mobile-accordion">
|
|
175
|
+
<summary class="wd-mobile-accordion-trigger">
|
|
176
|
+
<AppIcon icon={d.icon} class="wd-tab-icon" />
|
|
177
|
+
<span class="wd-mobile-accordion-label">{d.label}</span>
|
|
178
|
+
<svg class="wd-mobile-accordion-caret" width="12" height="12" viewBox="0 0 10 10" aria-hidden="true">
|
|
179
|
+
<path d="M2 3.5L5 6.5L8 3.5" stroke="currentColor" stroke-width="1.4" fill="none" stroke-linecap="round" stroke-linejoin="round" />
|
|
180
|
+
</svg>
|
|
181
|
+
</summary>
|
|
182
|
+
<div class="wd-mobile-accordion-options">
|
|
183
|
+
<div class="wd-mobile-accordion-options-panel">
|
|
184
|
+
{d.items.map((item) => (
|
|
185
|
+
<a href={siteHref(item.href)} class={item.active ? 'active' : ''}>
|
|
186
|
+
<span class="wd-mobile-accordion-option-label">{item.label}</span>
|
|
187
|
+
{item.active && (
|
|
188
|
+
<svg class="wd-mobile-accordion-check" width="14" height="14" viewBox="0 0 14 14" aria-hidden="true">
|
|
189
|
+
<path d="M3 7.5L6 10.5L11 4.5" stroke="currentColor" stroke-width="1.6" fill="none" stroke-linecap="round" stroke-linejoin="round" />
|
|
190
|
+
</svg>
|
|
191
|
+
)}
|
|
192
|
+
</a>
|
|
193
|
+
))}
|
|
194
|
+
</div>
|
|
195
|
+
</div>
|
|
196
|
+
</details>
|
|
197
|
+
)
|
|
198
|
+
)}
|
|
199
|
+
</div>
|
|
200
|
+
)}
|
|
201
|
+
{showSidebarCol && (
|
|
202
|
+
<div class="wd-mobile-menu-sidebar">
|
|
203
|
+
<slot name="sidebar" />
|
|
204
|
+
</div>
|
|
205
|
+
)}
|
|
206
|
+
</div>
|
|
207
|
+
</div>
|
|
208
|
+
</div>
|
|
209
|
+
)}
|
|
210
|
+
<script>
|
|
211
|
+
import { initMobileMenu } from '../../scripts/mobile-menu';
|
|
212
|
+
import { initThemeToggle } from '../../scripts/theme-toggle';
|
|
213
|
+
// Not required by any markup this component currently renders (its own
|
|
214
|
+
// accordion rows are plain <details>, not .wd-dropdown), but imported
|
|
215
|
+
// and called anyway so both this file and TopBar.astro consistently own
|
|
216
|
+
// wiring up whatever interactive primitives their own markup might use
|
|
217
|
+
// - safe/idempotent regardless of how many components call it, see
|
|
218
|
+
// src/scripts/dropdowns.ts's own comment.
|
|
219
|
+
import { initDropdowns } from '../../scripts/dropdowns';
|
|
220
|
+
|
|
221
|
+
initMobileMenu(document);
|
|
222
|
+
initThemeToggle(document);
|
|
223
|
+
initDropdowns(document);
|
|
224
|
+
document.addEventListener('astro:page-load', () => {
|
|
225
|
+
initMobileMenu(document);
|
|
226
|
+
initThemeToggle(document);
|
|
227
|
+
initDropdowns(document);
|
|
228
|
+
});
|
|
229
|
+
</script>
|