@brandon_m_behring/book-scaffold-astro 4.22.0 → 4.23.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/components/Sidebar.astro
CHANGED
|
@@ -14,16 +14,20 @@
|
|
|
14
14
|
* Visual: ~280px wide, sticky to top, scrollable independently of main.
|
|
15
15
|
* Site title at top doubles as a "home" link.
|
|
16
16
|
*
|
|
17
|
-
* Customize:
|
|
18
|
-
*
|
|
17
|
+
* Customize (v4.23.0, #135): the brand reads `defineBookConfig({ title,
|
|
18
|
+
* subtitle })` via the book-config virtual module — consumers set both in
|
|
19
|
+
* astro.config.mjs with zero component overrides. The previous hardcoded
|
|
20
|
+
* strings remain the fallbacks, so existing books render unchanged until
|
|
21
|
+
* they configure a title.
|
|
19
22
|
*/
|
|
20
23
|
import { getCollection } from 'astro:content';
|
|
24
|
+
import bookConfig from 'virtual:book-scaffold/book-config';
|
|
21
25
|
import { academicParts } from '../src/schemas';
|
|
22
26
|
import { academicPartHeading } from '../src/lib/academic-parts';
|
|
23
27
|
|
|
24
28
|
const profile = import.meta.env.BOOK_PROFILE ?? 'minimal';
|
|
25
|
-
const siteTitle = 'Book';
|
|
26
|
-
const siteSubtitle = 'A scaffold-astro book';
|
|
29
|
+
const siteTitle = bookConfig.title ?? 'Book';
|
|
30
|
+
const siteSubtitle = bookConfig.subtitle ?? 'A scaffold-astro book';
|
|
27
31
|
|
|
28
32
|
// Academic profile: part is a string enum. `academicParts` (schemas.ts) is
|
|
29
33
|
// the canonical order, shared with the renderer and ChapterHeader (#95); the
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AstroUserConfig, AstroIntegration } from 'astro';
|
|
2
|
-
import { c as BookConfigOptions, f as BookScaffoldIntegrationOptions, h as ChaptersRenderer, l as Style } from './types-
|
|
3
|
-
export { B as BOOK_PRESETS, a as BOOK_PROFILES, b as BookConfigError, d as BookPreset, e as BookProfile, g as BookSchemasOptions, C as ChapterFor, F as FreshnessAffordance, i as FrontmatterRouteConfig, P as PartKey, j as PartialRouteToggles, k as ProfileDefinition, R as RouteToggles, S as StatusBadge, m as StyleInput, V as VolatilityBadge, n as composeStyles, o as defineProfile, p as defineStyle, q as normalizeFrontmatterConfig, r as resolvePreset, s as resolveProfile } from './types-
|
|
2
|
+
import { c as BookConfigOptions, f as BookScaffoldIntegrationOptions, h as ChaptersRenderer, l as Style } from './types-CGN95mrX.js';
|
|
3
|
+
export { B as BOOK_PRESETS, a as BOOK_PROFILES, b as BookConfigError, d as BookPreset, e as BookProfile, g as BookSchemasOptions, C as ChapterFor, F as FreshnessAffordance, i as FrontmatterRouteConfig, P as PartKey, j as PartialRouteToggles, k as ProfileDefinition, R as RouteToggles, S as StatusBadge, m as StyleInput, V as VolatilityBadge, n as composeStyles, o as defineProfile, p as defineStyle, q as normalizeFrontmatterConfig, r as resolvePreset, s as resolveProfile } from './types-CGN95mrX.js';
|
|
4
4
|
import { D as volatilityLevels, c as academicParts, Q as Question } from './schemas-DDWDRUxs.js';
|
|
5
5
|
export { A as AcademicChapter, B as BloomLevel, C as CourseNotesChapter, G as GlossaryTerm, M as MinimalChapter, P as Provenance, a as QuestionType, R as ResearchPortfolioChapter, T as ToolsChapter, b as academicChapterSchema, d as bloomLevels, e as changeKinds, f as changelogSchema, g as chapterStatus, h as citationBackstops, i as courseNotesChapterSchema, j as glossarySchema, m as minimalChapterSchema, p as patternCategories, k as patternsSchema, l as provenanceObject, n as provenanceSchema, q as questionDifficulties, o as questionSchema, r as questionTypes, s as refineQuestion, t as refinedQuestionSchema, u as researchPortfolioChapterSchema, v as sourceTiers, w as sourceTiersResearch, x as sourcesSchema, y as toolSlugs, z as toolsChapterSchema } from './schemas-DDWDRUxs.js';
|
|
6
6
|
export { KIND_LABEL, ResolvedTheoremLabel, THEOREM_KINDS, TheoremKind, TheoremLabelProps, resolveTheoremNumber, theoremLabel } from './lib/theorem-label.js';
|
package/dist/index.mjs
CHANGED
|
@@ -1188,6 +1188,7 @@ function bookScaffoldIntegration(opts) {
|
|
|
1188
1188
|
mdxComponentsModule,
|
|
1189
1189
|
// v4.5.0: landing-page data, propagated via virtual module to /index.astro.
|
|
1190
1190
|
title,
|
|
1191
|
+
subtitle,
|
|
1191
1192
|
description,
|
|
1192
1193
|
portfolio,
|
|
1193
1194
|
// v4.6.0: book-level author + SEO config, propagated through the
|
|
@@ -1251,6 +1252,7 @@ function bookScaffoldIntegration(opts) {
|
|
|
1251
1252
|
makeMdxComponentsVitePlugin(resolvedMdxPath),
|
|
1252
1253
|
makeBookConfigVitePlugin({
|
|
1253
1254
|
title: title ?? null,
|
|
1255
|
+
subtitle: subtitle ?? null,
|
|
1254
1256
|
description: description ?? null,
|
|
1255
1257
|
portfolio: portfolio ?? false,
|
|
1256
1258
|
enabledRoutes: enabledRouteNames,
|
|
@@ -1388,6 +1390,8 @@ async function defineBookConfig(opts) {
|
|
|
1388
1390
|
// v4.5.0: pass landing-page data through to the integration so it can
|
|
1389
1391
|
// be exposed to the auto-injected /index.astro via the virtual module.
|
|
1390
1392
|
title: opts.title,
|
|
1393
|
+
// v4.23.0 (#135): sidebar brand subtitle.
|
|
1394
|
+
subtitle: opts.subtitle,
|
|
1391
1395
|
description: opts.description,
|
|
1392
1396
|
portfolio: resolvedPortfolio,
|
|
1393
1397
|
// v4.6.0: book-level author + SEO config (ogImage, twitterHandle),
|
|
@@ -1439,6 +1443,7 @@ async function defineBookConfig(opts) {
|
|
|
1439
1443
|
katexMacros: _katexMacros,
|
|
1440
1444
|
// v4.5.0: strip new landing-related opts so they don't leak into AstroUserConfig.
|
|
1441
1445
|
title: _title,
|
|
1446
|
+
subtitle: _subtitle,
|
|
1442
1447
|
description: _description,
|
|
1443
1448
|
portfolio: _portfolio,
|
|
1444
1449
|
// v4.6.0: strip new book-level SEO opts (author + seo block).
|
|
@@ -1463,6 +1468,7 @@ async function defineBookConfig(opts) {
|
|
|
1463
1468
|
void _markdown;
|
|
1464
1469
|
void _katexMacros;
|
|
1465
1470
|
void _title;
|
|
1471
|
+
void _subtitle;
|
|
1466
1472
|
void _description;
|
|
1467
1473
|
void _portfolio;
|
|
1468
1474
|
void _author;
|
package/dist/schemas.d.ts
CHANGED
|
@@ -592,6 +592,14 @@ interface BookConfigOptions {
|
|
|
592
592
|
* default <title> when no per-page title is supplied.
|
|
593
593
|
*/
|
|
594
594
|
title?: string;
|
|
595
|
+
/**
|
|
596
|
+
* v4.23.0 (#135): Sidebar brand subtitle — the second line under the brand
|
|
597
|
+
* title in the left chapter-nav. Optional; defaults to the scaffold's
|
|
598
|
+
* placeholder ('A scaffold-astro book') for backward compatibility. The
|
|
599
|
+
* brand TITLE is the existing `title` field above (previously the sidebar
|
|
600
|
+
* hardcoded both strings, so every consumer shipped the placeholder).
|
|
601
|
+
*/
|
|
602
|
+
subtitle?: string;
|
|
595
603
|
/**
|
|
596
604
|
* v4.5.0: Book description. Read by the auto-injected `/` landing page (lead paragraph + <meta description>).
|
|
597
605
|
* Optional; landing renders no description paragraph if unset.
|
|
@@ -708,6 +716,9 @@ interface BookScaffoldIntegrationOptions {
|
|
|
708
716
|
extraStyles?: readonly string[];
|
|
709
717
|
/** v4.5.0: book title, propagated to `/` landing via vite.define. */
|
|
710
718
|
title?: string;
|
|
719
|
+
/** v4.23.0 (#135): sidebar brand subtitle, propagated via the book-config
|
|
720
|
+
* virtual module to Sidebar.astro. */
|
|
721
|
+
subtitle?: string;
|
|
711
722
|
/** v4.5.0: book description, propagated to `/` landing via vite.define. */
|
|
712
723
|
description?: string;
|
|
713
724
|
/**
|
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.
|
|
4
|
+
"version": "4.23.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"author": "Brandon Behring",
|