@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.
Files changed (59) hide show
  1. package/astro.config.mjs +32 -8
  2. package/package.json +96 -93
  3. package/src/cli/base-path-layout.js +44 -0
  4. package/src/cli/build.js +177 -168
  5. package/src/cli/check-built-styles.js +41 -33
  6. package/src/cli/dev.js +261 -244
  7. package/src/cli/generate-api-pages.js +9 -5
  8. package/src/cli/page-list-watch.js +69 -66
  9. package/src/cli/run-pagefind.js +154 -148
  10. package/src/cli/write-mcp-files.js +103 -96
  11. package/src/cli/write-redirects-file.js +25 -8
  12. package/src/components/AppIcon.astro +51 -50
  13. package/src/components/Card.astro +193 -192
  14. package/src/components/CopyPageMenu.astro +374 -370
  15. package/src/components/Hint.astro +188 -187
  16. package/src/components/Icon.astro +72 -71
  17. package/src/components/Image.astro +165 -164
  18. package/src/components/Tile.astro +67 -66
  19. package/src/components/Video.astro +137 -136
  20. package/src/layout/BaseLayout.astro +21 -12
  21. package/src/layout/components/AnalyticsScripts.astro +6 -2
  22. package/src/layout/components/Breadcrumbs.astro +98 -97
  23. package/src/layout/components/ConsentBanner.astro +119 -118
  24. package/src/layout/components/MobileMenu.astro +229 -228
  25. package/src/layout/components/NavTree.astro +393 -392
  26. package/src/layout/components/Sidebar.astro +232 -231
  27. package/src/layout/components/SiteFooter.astro +87 -86
  28. package/src/layout/components/TopBar.astro +386 -385
  29. package/src/lib/agent-markdown.js +164 -162
  30. package/src/lib/asset-dimensions.js +89 -0
  31. package/src/lib/base-path.js +90 -0
  32. package/src/lib/config-schema.js +10 -0
  33. package/src/lib/config-schema.ts +17 -0
  34. package/src/lib/config.ts +1314 -1289
  35. package/src/lib/consent.js +108 -102
  36. package/src/lib/image-size.js +152 -140
  37. package/src/lib/json-schema-descriptions.js +1 -0
  38. package/src/lib/link-check.js +42 -4
  39. package/src/lib/llms-index.ts +90 -88
  40. package/src/lib/mcp-dev-integration.js +65 -60
  41. package/src/lib/mcp-index.ts +102 -101
  42. package/src/lib/pages.js +312 -304
  43. package/src/lib/project-files-integration.js +116 -61
  44. package/src/lib/project-files.js +137 -126
  45. package/src/lib/project-ignore.js +46 -0
  46. package/src/lib/rehype-base-path.js +62 -0
  47. package/src/lib/rehype-image-loading.js +71 -71
  48. package/src/lib/robots-txt.js +21 -16
  49. package/src/lib/seo-tags.js +155 -140
  50. package/src/lib/site-base.ts +27 -0
  51. package/src/lib/styles-asset-integration.js +58 -12
  52. package/src/lib/wdignore-cases.json +195 -0
  53. package/src/lib/wdignore.js +177 -0
  54. package/src/pages/404.astro +63 -62
  55. package/src/pages/[...slug].astro +1604 -1597
  56. package/src/pages/[...slug].md.ts +93 -93
  57. package/src/pages/llms-full.txt.ts +88 -86
  58. package/src/scripts/search.ts +241 -237
  59. package/writedocs.schema.json +6 -0
@@ -1,231 +1,232 @@
1
- ---
2
- import { isExternalHref, type NavTreeNode, type Selector } from "../../lib/config";
3
- import NavTree from "./NavTree.astro";
4
- import { currentOption } from "../../lib/selector-placement.js";
5
- import AppIcon from "../../components/AppIcon.astro";
6
- // Two colorways of the same "Powered by writedocs" mark, not a
7
- // theme-matched pair in the wd-logo-light/wd-logo-dark sense (that
8
- // convention names each file by which theme it's *shown in*) - these
9
- // are named by the mark's own ink color instead, and the darker one
10
- // (wd_watermark_dark.png) is actually the better-contrast choice
11
- // against the light theme's near-white background, while the lighter,
12
- // unsuffixed one reads better against the dark theme's near-black one.
13
- // Imported (not referenced by string path) since this is a
14
- // framework-bundled asset living in src/assets, not something any
15
- // individual site's own public/ folder provides - astro.config.mjs
16
- // points publicDir at the site's public/ instead, so a plain <img
17
- // src="/..."> here would 404 on every real site build.
18
- import watermarkForLightTheme from "../../assets/wd_watermark_dark.png";
19
- import watermarkForDarkTheme from "../../assets/wd_watermark.png";
20
-
21
- // Deploy-time-only opt-out, not a writedocs.json field: a site's own writedocs.json
22
- // is part of its checked-in content (something the author controls), while
23
- // this is meant to be set by whatever's actually running the build (CI,
24
- // hosting platform env config, etc.) without touching that content - the
25
- // same reasoning as WRITEDOCS_CONTENT_DIR/WRITEDOCS_PACKAGE_ROOT already
26
- // being plain process.env reads rather than config fields (see
27
- // astro.config.mjs and this component's sibling files). Any value other
28
- // than the literal string "true" leaves the watermark showing, so an
29
- // unset/misspelled var fails toward the visible, "unmodified" default
30
- // rather than silently hiding it.
31
- const watermarkDisabled = process.env.WRITEDOCS_DISABLE_WATERMARK === "true";
32
-
33
- interface Props {
34
- navTree: NavTreeNode[];
35
- hrefForSlug: (slug: string) => string;
36
- currentSlug: string;
37
- // Switchers that sit at the top of the sidebar instead of the top bar -
38
- // products inside a tab or dropdown (lib/selector-placement.js).
39
- switchers?: Selector[];
40
- }
41
- const { navTree, hrefForSlug, currentSlug, switchers = [] } = Astro.props as Props;
42
- ---
43
-
44
- <nav class="wd-sidebar">
45
- {switchers.map((sel) => {
46
- const current = currentOption(sel);
47
- return (
48
- <div class="wd-dropdown wd-sidebar-switcher" data-selector-kind={sel.kind}>
49
- <button type="button" class="wd-dropdown-trigger wd-sidebar-switcher-trigger" aria-expanded="false">
50
- <AppIcon icon={current.icon} class="wd-tab-icon wd-sidebar-switcher-icon" />
51
- <span class="wd-sidebar-switcher-text">
52
- <span class="wd-sidebar-switcher-label">{current.label}</span>
53
- {current.description && <span class="wd-sidebar-switcher-desc">{current.description}</span>}
54
- </span>
55
- <svg class="wd-sidebar-switcher-chevrons" width="12" height="12" viewBox="0 0 12 12" aria-hidden="true">
56
- <path d="M3.5 4.5L6 2L8.5 4.5M3.5 7.5L6 10L8.5 7.5" stroke="currentColor" stroke-width="1.3" fill="none" stroke-linecap="round" stroke-linejoin="round" />
57
- </svg>
58
- </button>
59
- <div class="wd-dropdown-menu wd-sidebar-switcher-menu">
60
- <div class="wd-dropdown-menu-panel">
61
- {sel.options.map((opt) => (
62
- <a
63
- href={opt.href}
64
- class={opt.active ? "active" : ""}
65
- aria-current={opt.active ? "true" : undefined}
66
- target={isExternalHref(opt.href) ? "_blank" : undefined}
67
- rel={isExternalHref(opt.href) ? "noopener noreferrer" : undefined}
68
- >
69
- <AppIcon icon={opt.icon} class="wd-tab-icon wd-sidebar-switcher-icon" />
70
- <span class="wd-sidebar-switcher-text">
71
- <span class="wd-sidebar-switcher-label">{opt.label}</span>
72
- {opt.description && <span class="wd-sidebar-switcher-desc">{opt.description}</span>}
73
- </span>
74
- </a>
75
- ))}
76
- </div>
77
- </div>
78
- </div>
79
- );
80
- })}
81
- <NavTree nodes={navTree} hrefForSlug={hrefForSlug} currentSlug={currentSlug} />
82
- {!watermarkDisabled && (
83
- <div class="wd-sidebar-watermark">
84
- <img src={watermarkForLightTheme.src} alt="Powered by writedocs" class="wd-watermark-light" width={watermarkForLightTheme.width} height={watermarkForLightTheme.height} loading="lazy" decoding="async" />
85
- <img src={watermarkForDarkTheme.src} alt="Powered by writedocs" class="wd-watermark-dark" width={watermarkForDarkTheme.width} height={watermarkForDarkTheme.height} loading="lazy" decoding="async" />
86
- </div>
87
- )}
88
- </nav>
89
- <style>
90
- /* The product switcher at the top of the sidebar - Mintlify's place for
91
- it. Full width, the current product (and its description) on the
92
- button, every product in the menu. It opens on click only: the shared
93
- hover-to-open (dropdown.css) would pop it open every time the pointer
94
- crosses the sidebar. */
95
- .wd-sidebar-switcher {
96
- margin-bottom: 1rem;
97
- }
98
- .wd-sidebar-switcher-trigger {
99
- width: 100%;
100
- box-sizing: border-box;
101
- gap: 0.6rem;
102
- padding: 0.5rem 0.65rem;
103
- border: 1px solid var(--wd-border);
104
- border-radius: 0.5rem;
105
- color: var(--wd-text);
106
- text-align: left;
107
- }
108
- .wd-sidebar-switcher-trigger:hover {
109
- background: var(--wd-surface);
110
- }
111
- .wd-sidebar-switcher-text {
112
- display: flex;
113
- flex-direction: column;
114
- flex: 1;
115
- min-width: 0;
116
- }
117
- .wd-sidebar-switcher-label {
118
- font-size: 0.88rem;
119
- font-weight: 600;
120
- overflow: hidden;
121
- text-overflow: ellipsis;
122
- white-space: nowrap;
123
- }
124
- .wd-sidebar-switcher-desc {
125
- font-size: 0.75rem;
126
- font-weight: 400;
127
- color: var(--wd-text-muted);
128
- }
129
- .wd-sidebar-switcher-trigger .wd-sidebar-switcher-desc {
130
- overflow: hidden;
131
- text-overflow: ellipsis;
132
- white-space: nowrap;
133
- }
134
- .wd-sidebar-switcher-chevrons {
135
- flex-shrink: 0;
136
- color: var(--wd-text-muted);
137
- }
138
- .wd-sidebar-switcher:not(.open) .wd-sidebar-switcher-menu {
139
- display: none;
140
- }
141
- .wd-sidebar-switcher-menu {
142
- right: 0;
143
- }
144
- .wd-sidebar-switcher-menu .wd-dropdown-menu-panel {
145
- min-width: 0;
146
- }
147
- .wd-sidebar-switcher-menu a {
148
- align-items: flex-start;
149
- }
150
- .wd-sidebar-switcher-menu .wd-sidebar-switcher-icon {
151
- margin-top: 0.2rem;
152
- }
153
- /* The mobile menu already lists every level as its own row above the
154
- sidebar - no second copy there. */
155
- :global(#wd-mobile-menu) .wd-sidebar-switcher {
156
- display: none;
157
- }
158
- /* Sticky + its own scrollbar, not just "moves along until it runs out
159
- of column to stick within" (position: sticky's default behavior,
160
- which is what this had before - a tall nav tree would eventually
161
- unstick and get carried away by the page's own scroll once
162
- .wd-sidebar-col's bottom edge passed the viewport). max-height caps
163
- it to the visible area below the topbar and overflow-y gives it an
164
- independent scrollbar, so the page scrolls its content while the
165
- sidebar scrolls itself - same treatment TableOfContents.astro's
166
- .wd-toc already has (deliberately matching its `top`/`max-height`
167
- values exactly, so both columns start scrolling at the same height
168
- when a page has both). Reset back to normal (non-sticky, no cap) on
169
- narrow screens in BaseLayout.astro's `@media (max-width: 860px)`
170
- block, where the sidebar stacks full-width above the content instead
171
- of sitting beside it. */
172
- .wd-sidebar {
173
- padding: 1.5rem 1rem 1.5rem 0;
174
- position: sticky;
175
- /* --wd-topbar-offset (src/scripts/topbar-offset.ts) is the topbar's
176
- real measured height - a fixed 5rem (this var()'s own fallback)
177
- only matched the topbar's simplest, single-row case; matched
178
- exactly by TableOfContents.astro's own .wd-toc, see this file's
179
- own comment above on why that pairing matters. */
180
- top: var(--wd-topbar-offset, 5rem);
181
- max-height: calc(100vh - var(--wd-topbar-offset, 5rem));
182
- overflow-y: auto;
183
- }
184
- /* Desktop only (see the :global(.wd-sidebar-col) guard) - turns the
185
- sidebar into a fixed-height flex column so .wd-sidebar-watermark's
186
- margin-top: auto below can push it all the way to the bottom of the
187
- visible area when the nav tree doesn't fill it, instead of sitting
188
- right after the last nav item with a gap of empty space beneath it.
189
- height (not just the max-height above) is what makes this work -
190
- max-height alone only caps how tall the box *can* get, it doesn't
191
- force it to actually be that tall when content is shorter, which is
192
- exactly the "empty space below the watermark" case this replaces.
193
- Scoped to .wd-sidebar-col specifically (not the plain .wd-sidebar
194
- this component always renders) so the *reused* copy inside
195
- MobileMenu.astro's own scrollable panel is untouched - forcing a
196
- tall fixed height there would leave an awkward blank stretch inside
197
- the mobile drawer under a short nav list, where "pinned to the
198
- bottom of the screen" isn't really representative of a panel the
199
- reader can already see the bottom of by scrolling. */
200
- :global(.wd-sidebar-col) .wd-sidebar {
201
- height: calc(100vh - var(--wd-topbar-offset, 5rem));
202
- display: flex;
203
- flex-direction: column;
204
- }
205
- /* Last thing in the nav column. margin-top: auto only has real estate
206
- to push into on desktop (where the rule above gives .wd-sidebar a
207
- real fixed height) - inside the mobile menu's reused copy, .wd-
208
- sidebar is never a flex container, so this margin resolves to 0 and
209
- the watermark just falls in after the last nav item instead, same
210
- as before that rule existed. Either way, padding-top + border-top
211
- stay unconditional, so there's always at least that much separation
212
- from the nav items above it. */
213
- .wd-sidebar-watermark {
214
- margin-top: auto;
215
- padding-top: 1rem;
216
- border-top: 1px solid var(--wd-border);
217
- }
218
- /* No `display` here - that's the base.css wd-watermark-light/-dark
219
- toggle's job alone (default display:none on the inactive one,
220
- display:block on the active one). This rule's own selector
221
- specificity (a class + an attribute-scoping selector + a type
222
- selector) is higher than that toggle's plain single/double-class
223
- rules, so a `display: block` here would win the cascade
224
- unconditionally on BOTH images regardless of [data-theme] -
225
- exactly the "both always visible" bug this replaces. */
226
- .wd-sidebar-watermark img {
227
- height: 14px;
228
- width: auto;
229
- opacity: 0.7;
230
- }
231
- </style>
1
+ ---
2
+ import { isExternalHref, type NavTreeNode, type Selector } from "../../lib/config";
3
+ import NavTree from "./NavTree.astro";
4
+ import { currentOption } from "../../lib/selector-placement.js";
5
+ import AppIcon from "../../components/AppIcon.astro";
6
+ // Two colorways of the same "Powered by writedocs" mark, not a
7
+ // theme-matched pair in the wd-logo-light/wd-logo-dark sense (that
8
+ // convention names each file by which theme it's *shown in*) - these
9
+ // are named by the mark's own ink color instead, and the darker one
10
+ // (wd_watermark_dark.png) is actually the better-contrast choice
11
+ // against the light theme's near-white background, while the lighter,
12
+ // unsuffixed one reads better against the dark theme's near-black one.
13
+ // Imported (not referenced by string path) since this is a
14
+ // framework-bundled asset living in src/assets, not something any
15
+ // individual site's own public/ folder provides - astro.config.mjs
16
+ // points publicDir at the site's public/ instead, so a plain <img
17
+ // src="/..."> here would 404 on every real site build.
18
+ import watermarkForLightTheme from "../../assets/wd_watermark_dark.png";
19
+ import watermarkForDarkTheme from "../../assets/wd_watermark.png";
20
+ import { siteHref } from '../../lib/site-base';
21
+
22
+ // Deploy-time-only opt-out, not a writedocs.json field: a site's own writedocs.json
23
+ // is part of its checked-in content (something the author controls), while
24
+ // this is meant to be set by whatever's actually running the build (CI,
25
+ // hosting platform env config, etc.) without touching that content - the
26
+ // same reasoning as WRITEDOCS_CONTENT_DIR/WRITEDOCS_PACKAGE_ROOT already
27
+ // being plain process.env reads rather than config fields (see
28
+ // astro.config.mjs and this component's sibling files). Any value other
29
+ // than the literal string "true" leaves the watermark showing, so an
30
+ // unset/misspelled var fails toward the visible, "unmodified" default
31
+ // rather than silently hiding it.
32
+ const watermarkDisabled = process.env.WRITEDOCS_DISABLE_WATERMARK === "true";
33
+
34
+ interface Props {
35
+ navTree: NavTreeNode[];
36
+ hrefForSlug: (slug: string) => string;
37
+ currentSlug: string;
38
+ // Switchers that sit at the top of the sidebar instead of the top bar -
39
+ // products inside a tab or dropdown (lib/selector-placement.js).
40
+ switchers?: Selector[];
41
+ }
42
+ const { navTree, hrefForSlug, currentSlug, switchers = [] } = Astro.props as Props;
43
+ ---
44
+
45
+ <nav class="wd-sidebar">
46
+ {switchers.map((sel) => {
47
+ const current = currentOption(sel);
48
+ return (
49
+ <div class="wd-dropdown wd-sidebar-switcher" data-selector-kind={sel.kind}>
50
+ <button type="button" class="wd-dropdown-trigger wd-sidebar-switcher-trigger" aria-expanded="false">
51
+ <AppIcon icon={current.icon} class="wd-tab-icon wd-sidebar-switcher-icon" />
52
+ <span class="wd-sidebar-switcher-text">
53
+ <span class="wd-sidebar-switcher-label">{current.label}</span>
54
+ {current.description && <span class="wd-sidebar-switcher-desc">{current.description}</span>}
55
+ </span>
56
+ <svg class="wd-sidebar-switcher-chevrons" width="12" height="12" viewBox="0 0 12 12" aria-hidden="true">
57
+ <path d="M3.5 4.5L6 2L8.5 4.5M3.5 7.5L6 10L8.5 7.5" stroke="currentColor" stroke-width="1.3" fill="none" stroke-linecap="round" stroke-linejoin="round" />
58
+ </svg>
59
+ </button>
60
+ <div class="wd-dropdown-menu wd-sidebar-switcher-menu">
61
+ <div class="wd-dropdown-menu-panel">
62
+ {sel.options.map((opt) => (
63
+ <a
64
+ href={siteHref(opt.href)}
65
+ class={opt.active ? "active" : ""}
66
+ aria-current={opt.active ? "true" : undefined}
67
+ target={isExternalHref(opt.href) ? "_blank" : undefined}
68
+ rel={isExternalHref(opt.href) ? "noopener noreferrer" : undefined}
69
+ >
70
+ <AppIcon icon={opt.icon} class="wd-tab-icon wd-sidebar-switcher-icon" />
71
+ <span class="wd-sidebar-switcher-text">
72
+ <span class="wd-sidebar-switcher-label">{opt.label}</span>
73
+ {opt.description && <span class="wd-sidebar-switcher-desc">{opt.description}</span>}
74
+ </span>
75
+ </a>
76
+ ))}
77
+ </div>
78
+ </div>
79
+ </div>
80
+ );
81
+ })}
82
+ <NavTree nodes={navTree} hrefForSlug={hrefForSlug} currentSlug={currentSlug} />
83
+ {!watermarkDisabled && (
84
+ <div class="wd-sidebar-watermark">
85
+ <img src={watermarkForLightTheme.src} alt="Powered by writedocs" class="wd-watermark-light" width={watermarkForLightTheme.width} height={watermarkForLightTheme.height} loading="lazy" decoding="async" />
86
+ <img src={watermarkForDarkTheme.src} alt="Powered by writedocs" class="wd-watermark-dark" width={watermarkForDarkTheme.width} height={watermarkForDarkTheme.height} loading="lazy" decoding="async" />
87
+ </div>
88
+ )}
89
+ </nav>
90
+ <style>
91
+ /* The product switcher at the top of the sidebar - Mintlify's place for
92
+ it. Full width, the current product (and its description) on the
93
+ button, every product in the menu. It opens on click only: the shared
94
+ hover-to-open (dropdown.css) would pop it open every time the pointer
95
+ crosses the sidebar. */
96
+ .wd-sidebar-switcher {
97
+ margin-bottom: 1rem;
98
+ }
99
+ .wd-sidebar-switcher-trigger {
100
+ width: 100%;
101
+ box-sizing: border-box;
102
+ gap: 0.6rem;
103
+ padding: 0.5rem 0.65rem;
104
+ border: 1px solid var(--wd-border);
105
+ border-radius: 0.5rem;
106
+ color: var(--wd-text);
107
+ text-align: left;
108
+ }
109
+ .wd-sidebar-switcher-trigger:hover {
110
+ background: var(--wd-surface);
111
+ }
112
+ .wd-sidebar-switcher-text {
113
+ display: flex;
114
+ flex-direction: column;
115
+ flex: 1;
116
+ min-width: 0;
117
+ }
118
+ .wd-sidebar-switcher-label {
119
+ font-size: 0.88rem;
120
+ font-weight: 600;
121
+ overflow: hidden;
122
+ text-overflow: ellipsis;
123
+ white-space: nowrap;
124
+ }
125
+ .wd-sidebar-switcher-desc {
126
+ font-size: 0.75rem;
127
+ font-weight: 400;
128
+ color: var(--wd-text-muted);
129
+ }
130
+ .wd-sidebar-switcher-trigger .wd-sidebar-switcher-desc {
131
+ overflow: hidden;
132
+ text-overflow: ellipsis;
133
+ white-space: nowrap;
134
+ }
135
+ .wd-sidebar-switcher-chevrons {
136
+ flex-shrink: 0;
137
+ color: var(--wd-text-muted);
138
+ }
139
+ .wd-sidebar-switcher:not(.open) .wd-sidebar-switcher-menu {
140
+ display: none;
141
+ }
142
+ .wd-sidebar-switcher-menu {
143
+ right: 0;
144
+ }
145
+ .wd-sidebar-switcher-menu .wd-dropdown-menu-panel {
146
+ min-width: 0;
147
+ }
148
+ .wd-sidebar-switcher-menu a {
149
+ align-items: flex-start;
150
+ }
151
+ .wd-sidebar-switcher-menu .wd-sidebar-switcher-icon {
152
+ margin-top: 0.2rem;
153
+ }
154
+ /* The mobile menu already lists every level as its own row above the
155
+ sidebar - no second copy there. */
156
+ :global(#wd-mobile-menu) .wd-sidebar-switcher {
157
+ display: none;
158
+ }
159
+ /* Sticky + its own scrollbar, not just "moves along until it runs out
160
+ of column to stick within" (position: sticky's default behavior,
161
+ which is what this had before - a tall nav tree would eventually
162
+ unstick and get carried away by the page's own scroll once
163
+ .wd-sidebar-col's bottom edge passed the viewport). max-height caps
164
+ it to the visible area below the topbar and overflow-y gives it an
165
+ independent scrollbar, so the page scrolls its content while the
166
+ sidebar scrolls itself - same treatment TableOfContents.astro's
167
+ .wd-toc already has (deliberately matching its `top`/`max-height`
168
+ values exactly, so both columns start scrolling at the same height
169
+ when a page has both). Reset back to normal (non-sticky, no cap) on
170
+ narrow screens in BaseLayout.astro's `@media (max-width: 860px)`
171
+ block, where the sidebar stacks full-width above the content instead
172
+ of sitting beside it. */
173
+ .wd-sidebar {
174
+ padding: 1.5rem 1rem 1.5rem 0;
175
+ position: sticky;
176
+ /* --wd-topbar-offset (src/scripts/topbar-offset.ts) is the topbar's
177
+ real measured height - a fixed 5rem (this var()'s own fallback)
178
+ only matched the topbar's simplest, single-row case; matched
179
+ exactly by TableOfContents.astro's own .wd-toc, see this file's
180
+ own comment above on why that pairing matters. */
181
+ top: var(--wd-topbar-offset, 5rem);
182
+ max-height: calc(100vh - var(--wd-topbar-offset, 5rem));
183
+ overflow-y: auto;
184
+ }
185
+ /* Desktop only (see the :global(.wd-sidebar-col) guard) - turns the
186
+ sidebar into a fixed-height flex column so .wd-sidebar-watermark's
187
+ margin-top: auto below can push it all the way to the bottom of the
188
+ visible area when the nav tree doesn't fill it, instead of sitting
189
+ right after the last nav item with a gap of empty space beneath it.
190
+ height (not just the max-height above) is what makes this work -
191
+ max-height alone only caps how tall the box *can* get, it doesn't
192
+ force it to actually be that tall when content is shorter, which is
193
+ exactly the "empty space below the watermark" case this replaces.
194
+ Scoped to .wd-sidebar-col specifically (not the plain .wd-sidebar
195
+ this component always renders) so the *reused* copy inside
196
+ MobileMenu.astro's own scrollable panel is untouched - forcing a
197
+ tall fixed height there would leave an awkward blank stretch inside
198
+ the mobile drawer under a short nav list, where "pinned to the
199
+ bottom of the screen" isn't really representative of a panel the
200
+ reader can already see the bottom of by scrolling. */
201
+ :global(.wd-sidebar-col) .wd-sidebar {
202
+ height: calc(100vh - var(--wd-topbar-offset, 5rem));
203
+ display: flex;
204
+ flex-direction: column;
205
+ }
206
+ /* Last thing in the nav column. margin-top: auto only has real estate
207
+ to push into on desktop (where the rule above gives .wd-sidebar a
208
+ real fixed height) - inside the mobile menu's reused copy, .wd-
209
+ sidebar is never a flex container, so this margin resolves to 0 and
210
+ the watermark just falls in after the last nav item instead, same
211
+ as before that rule existed. Either way, padding-top + border-top
212
+ stay unconditional, so there's always at least that much separation
213
+ from the nav items above it. */
214
+ .wd-sidebar-watermark {
215
+ margin-top: auto;
216
+ padding-top: 1rem;
217
+ border-top: 1px solid var(--wd-border);
218
+ }
219
+ /* No `display` here - that's the base.css wd-watermark-light/-dark
220
+ toggle's job alone (default display:none on the inactive one,
221
+ display:block on the active one). This rule's own selector
222
+ specificity (a class + an attribute-scoping selector + a type
223
+ selector) is higher than that toggle's plain single/double-class
224
+ rules, so a `display: block` here would win the cascade
225
+ unconditionally on BOTH images regardless of [data-theme] -
226
+ exactly the "both always visible" bug this replaces. */
227
+ .wd-sidebar-watermark img {
228
+ height: 14px;
229
+ width: auto;
230
+ opacity: 0.7;
231
+ }
232
+ </style>