@brandon_m_behring/book-scaffold-astro 4.25.1 → 4.25.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/layouts/Base.astro +19 -3
- package/package.json +1 -1
- package/styles/chapter.css +15 -0
package/layouts/Base.astro
CHANGED
|
@@ -16,10 +16,14 @@
|
|
|
16
16
|
* showSidebar — render the left chapter-navigation sidebar (default: true).
|
|
17
17
|
* Set false for the landing page or any full-bleed surface.
|
|
18
18
|
* Below 1024px the sidebar is auto-hidden via CSS regardless.
|
|
19
|
+
* showChrome — render the tools chrome (ToolFilter + VersionSelector)
|
|
20
|
+
* (default: true). Set false on a landing/hub page with no
|
|
21
|
+
* chapters/tools/versions; search + theme toggle always render.
|
|
19
22
|
*
|
|
20
23
|
* Tools chrome (ToolFilter, VersionSelector): only mounted when
|
|
21
|
-
* BOOK_PROFILE !== 'academic'. Academic-profile books
|
|
22
|
-
*
|
|
24
|
+
* BOOK_PROFILE !== 'academic' AND showChrome !== false. Academic-profile books
|
|
25
|
+
* (and any page with showChrome={false}) get no JS islands in the chrome row
|
|
26
|
+
* (search + theme toggle only).
|
|
23
27
|
*
|
|
24
28
|
* Usage:
|
|
25
29
|
* ---
|
|
@@ -61,13 +65,17 @@ import Sidebar from '../components/Sidebar.astro';
|
|
|
61
65
|
import bookConfig from 'virtual:book-scaffold/book-config';
|
|
62
66
|
|
|
63
67
|
const profile = import.meta.env.BOOK_PROFILE ?? 'minimal';
|
|
64
|
-
const showToolsChrome = profile !== 'academic';
|
|
65
68
|
|
|
66
69
|
interface Props {
|
|
67
70
|
title: string;
|
|
68
71
|
description?: string;
|
|
69
72
|
lang?: string;
|
|
70
73
|
showSidebar?: boolean;
|
|
74
|
+
/** #163: render the optional "tools chrome" — the ToolFilter +
|
|
75
|
+
* VersionSelector islands (default true). Set false on landing/hub pages
|
|
76
|
+
* with no chapters/tools/versions; the search + theme-toggle cluster always
|
|
77
|
+
* renders. (No-op for the academic profile, which never shows them.) */
|
|
78
|
+
showChrome?: boolean;
|
|
71
79
|
/** v4.6.0: Open Graph image URL (relative to site root, or absolute). */
|
|
72
80
|
ogImage?: string;
|
|
73
81
|
/** v4.6.0: Open Graph type. Defaults to 'website'; Chapter.astro passes 'article'. */
|
|
@@ -79,10 +87,18 @@ const {
|
|
|
79
87
|
description,
|
|
80
88
|
lang = 'en',
|
|
81
89
|
showSidebar = true,
|
|
90
|
+
showChrome = true,
|
|
82
91
|
ogImage,
|
|
83
92
|
ogType = 'website',
|
|
84
93
|
} = Astro.props;
|
|
85
94
|
|
|
95
|
+
// Tools chrome (ToolFilter + VersionSelector) renders only for non-academic
|
|
96
|
+
// profiles AND when the page opts in via showChrome (default true). A
|
|
97
|
+
// landing/hub page (no chapters/tools/versions) passes showChrome={false} to
|
|
98
|
+
// get the search + theme-toggle cluster only — the chrome-free path that
|
|
99
|
+
// previously forced borrowing the academic profile (and its katex deps). #163.
|
|
100
|
+
const showToolsChrome = (profile !== 'academic') && showChrome;
|
|
101
|
+
|
|
86
102
|
// v4.6.0: canonical + og:url need Astro.site. defineBookConfig throws at
|
|
87
103
|
// config-load if `site` is missing, so Astro.site is guaranteed populated
|
|
88
104
|
// here. `new URL` resolves the relative pathname against it.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brandon_m_behring/book-scaffold-astro",
|
|
3
3
|
"description": "Astro 6 + MDX toolkit for long-form technical books. Profile-aware (academic / tools / minimal); ships Tufte typography, KaTeX, BibTeX citations, Pagefind, Cloudflare Workers deploy. See PACKAGE_DESIGN.md for the API contract.",
|
|
4
|
-
"version": "4.25.
|
|
4
|
+
"version": "4.25.2",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"author": "Brandon Behring",
|
package/styles/chapter.css
CHANGED
|
@@ -230,3 +230,18 @@
|
|
|
230
230
|
}
|
|
231
231
|
.chapter-nav .next { grid-column: 1; text-align: left; }
|
|
232
232
|
}
|
|
233
|
+
|
|
234
|
+
/* Display math (KaTeX) — scroll a too-wide equation WITHIN its own block instead
|
|
235
|
+
of forcing a horizontal scroll on the whole page. KaTeX sets no `overflow` on
|
|
236
|
+
`.katex-display`, so it defaults to `visible`; a wide equation (long
|
|
237
|
+
derivations, big matrices) then overflows the viewport and the page scrolls
|
|
238
|
+
sideways on mobile. WCAG 1.4.10 Reflow. See book-scaffold-astro#162.
|
|
239
|
+
overflow-y is deliberately NOT set: once overflow-x is non-visible the CSS
|
|
240
|
+
overflow rule already computes overflow-y to `auto`, so there is no spurious
|
|
241
|
+
vertical scrollbar — and an explicit `hidden` would silently clip tall
|
|
242
|
+
equations if a consumer ever constrains .katex-display's height. */
|
|
243
|
+
.katex-display {
|
|
244
|
+
overflow-x: auto;
|
|
245
|
+
/* a little room so the horizontal scrollbar doesn't clip the equation's descenders */
|
|
246
|
+
padding-block-end: 0.25rem;
|
|
247
|
+
}
|