blume 0.6.0 → 0.6.1

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.
@@ -126,6 +126,12 @@ interface Props {
126
126
  clientData?: BlumeClientData | null;
127
127
  /** Table-of-contents settings (`toc` config): visibility + heading range. */
128
128
  toc?: { enabled: boolean; maxLevel: number; minLevel: number };
129
+ /**
130
+ * Content-column preset. `"bare"` (the generated changelog index) drops both
131
+ * the sidebar and the table of contents and centers a single wide column;
132
+ * everything else uses the standard sidebar + content + TOC grid.
133
+ */
134
+ contentLayout?: "default" | "bare";
129
135
  }
130
136
 
131
137
  const {
@@ -169,6 +175,7 @@ const {
169
175
  layout = {},
170
176
  clientData,
171
177
  toc = { enabled: true, maxLevel: 3, minLevel: 2 },
178
+ contentLayout = "default",
172
179
  } = Astro.props;
173
180
 
174
181
  // Serialized once for island hooks; `<` escaped so content can't break the tag.
@@ -205,16 +212,28 @@ const searchLocale =
205
212
  // API operation pages own a two-column body (docs + request panel) and their own
206
213
  // right rail, so they drop the table of contents and widen the content column.
207
214
  const isApiOperation = pageType === "openapi-operation";
215
+ // A "bare" page (the changelog index) is a standalone landing: no sidebar, no
216
+ // TOC, just a wider centered column of content.
217
+ const isBare = contentLayout === "bare";
218
+ const showSidebar = !isBare;
219
+ const showToc = !(isApiOperation || isBare);
208
220
  const tocHeadings =
209
- toc.enabled && !isApiOperation
221
+ toc.enabled && showToc
210
222
  ? headings.filter((h) => h.depth >= toc.minLevel && h.depth <= toc.maxLevel)
211
223
  : [];
212
- const gridClass = isApiOperation
213
- ? "lg:grid-cols-[17.5rem_minmax(0,1fr)]"
214
- : "lg:grid-cols-[17.5rem_minmax(0,1fr)] xl:grid-cols-[17.5rem_minmax(0,1fr)_17.5rem]";
215
- const articleClass = isApiOperation
216
- ? "prose max-w-none"
217
- : "prose mx-auto max-w-[42rem]";
224
+ let gridClass =
225
+ "lg:grid-cols-[17.5rem_minmax(0,1fr)] xl:grid-cols-[17.5rem_minmax(0,1fr)_17.5rem]";
226
+ if (isBare) {
227
+ gridClass = "";
228
+ } else if (isApiOperation) {
229
+ gridClass = "lg:grid-cols-[17.5rem_minmax(0,1fr)]";
230
+ }
231
+ let articleClass = "prose mx-auto max-w-[42rem]";
232
+ if (isBare) {
233
+ articleClass = "prose mx-auto max-w-[54rem]";
234
+ } else if (isApiOperation) {
235
+ articleClass = "prose max-w-none";
236
+ }
218
237
  const pageTitle = page.title ? `${page.title} - ${site.title}` : site.title;
219
238
  const description = page.description ?? site.description;
220
239
 
@@ -347,6 +366,8 @@ const bannerScript = banner?.dismissible
347
366
  class:list={["mx-auto grid grid-cols-1 items-start", gridClass]}
348
367
  data-blume-doc-grid
349
368
  >
369
+ {
370
+ showSidebar && (
350
371
  <aside
351
372
  aria-label="Primary"
352
373
  class="fixed top-[var(--blume-drawer-top,4rem)] start-0 z-[35] h-[calc(100dvh-var(--blume-drawer-top,4rem))] w-64 max-w-[80vw] -translate-x-[105%] overflow-y-auto border-border border-e bg-background px-5 pt-4 pb-6 transition-transform rtl:translate-x-[105%] [:where([data-blume-nav-open])_&]:translate-x-0! lg:sticky lg:top-16 lg:z-auto lg:h-[calc(100dvh-4rem)] lg:w-auto lg:max-w-none lg:translate-x-0! lg:border-e-0 lg:bg-transparent lg:px-4"
@@ -438,6 +459,8 @@ const bannerScript = banner?.dismissible
438
459
  }
439
460
  </nav>
440
461
  </aside>
462
+ )
463
+ }
441
464
  <main class="px-6 pt-6 pb-10 lg:px-8 xl:px-10" id="blume-content">
442
465
  <BreadcrumbsSlot crumbs={crumbs} wide={isApiOperation} />
443
466
  <TableOfContentsSlot
@@ -469,7 +492,7 @@ const bannerScript = banner?.dismissible
469
492
  }
470
493
  </main>
471
494
  {
472
- !isApiOperation && (
495
+ showToc && (
473
496
  <aside
474
497
  aria-label={strings.toc.title}
475
498
  class="sticky top-16 hidden h-[calc(100dvh-4rem)] overflow-y-auto px-4 pt-6 pb-10 text-sm xl:block"