blume 0.6.5 → 0.6.7

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "blume",
3
- "version": "0.6.5",
3
+ "version": "0.6.7",
4
4
  "description": "Documentation that's fast, AI-ready, and zero-config.",
5
5
  "keywords": [
6
6
  "astro",
@@ -70,7 +70,7 @@ const tagList = Array.isArray(tags) ? tags : tags ? [tags] : [];
70
70
  )
71
71
  }
72
72
  </header>
73
- <div class="text-muted-foreground text-sm leading-6 [&_a]:font-medium [&_a]:text-foreground [&_a]:underline [&_code]:rounded [&_code]:bg-muted [&_code]:px-1 [&_h2]:mt-0! [&_h2]:border-t-0! [&_h2]:pt-0! [&_h2]:text-base [&_h2]:font-semibold [&_h2]:text-foreground [&_h3]:font-semibold [&_h3]:text-foreground [&_img]:rounded-blume [&_li]:my-1 [&_p:first-child]:mt-0! [&_p:last-child]:mb-0!">
73
+ <div class="text-muted-foreground text-sm leading-6 [&_a]:font-medium [&_a]:text-foreground [&_a]:underline [&_code]:rounded [&_code]:bg-muted [&_code]:px-1 [&_h2]:mt-6! [&_h2]:border-t-0! [&_h2]:pt-0! [&_h2]:text-base [&_h2]:font-semibold [&_h2]:text-foreground [&_h3]:mt-4! [&_h3]:font-semibold [&_h3]:text-foreground [&_img]:rounded-blume [&_li]:my-1 [&_p]:my-3! [&>:first-child]:mt-0! [&>:last-child]:mb-0!">
74
74
  <slot />
75
75
  </div>
76
76
  </article>
@@ -201,6 +201,28 @@ const hoistPages = (nodes: MutableNode[], recurse: boolean): void => {
201
201
  }
202
202
  };
203
203
 
204
+ /**
205
+ * With tabs configured, the sidebar shown under a tab is that tab-section
206
+ * group's *children*, not the tree root — so hoisting only the root leaves a
207
+ * tab section's loose pages interleaved with its groups. Hoist the top level of
208
+ * every group that owns a tab (matched on its URL path), mirroring the root.
209
+ */
210
+ const hoistTabSections = (
211
+ nodes: MutableNode[],
212
+ tabPaths: Set<string>,
213
+ recurse: boolean
214
+ ): void => {
215
+ for (const node of nodes) {
216
+ if (node.kind !== "group") {
217
+ continue;
218
+ }
219
+ if (node.routePath !== undefined && tabPaths.has(node.routePath)) {
220
+ hoistPages(node.children, recurse);
221
+ }
222
+ hoistTabSections(node.children, tabPaths, recurse);
223
+ }
224
+ };
225
+
204
226
  const toNavNode = (node: MutableNode, display: SidebarDisplay): NavNode => {
205
227
  if (node.kind === "page") {
206
228
  return {
@@ -231,7 +253,8 @@ const buildFileSystemSidebar = (
231
253
  folderMeta: Map<string, FolderMeta>,
232
254
  sharedMeta: Map<string, FolderMeta>,
233
255
  metaPrefix: string,
234
- display: SidebarDisplay
256
+ display: SidebarDisplay,
257
+ tabPaths: Set<string>
235
258
  ): NavNode[] => {
236
259
  const root = createGroup("", "", "", 0);
237
260
 
@@ -285,6 +308,7 @@ const buildFileSystemSidebar = (
285
308
  applyFolderMeta(root, folderMeta, sharedMeta, metaPrefix);
286
309
  sortNodes(root.children);
287
310
  hoistPages(root.children, display === "flat");
311
+ hoistTabSections(root.children, tabPaths, display === "flat");
288
312
  return root.children.map((child) => toNavNode(child, display));
289
313
  };
290
314
 
@@ -434,7 +458,8 @@ export const buildNavigation = (
434
458
  options.folderMeta,
435
459
  sharedFolderMeta,
436
460
  metaPrefix,
437
- display
461
+ display,
462
+ new Set(tabs.map((tab) => tab.path).filter((path) => path !== "/"))
438
463
  ),
439
464
  tabs,
440
465
  };
@@ -604,7 +604,7 @@ pre:has(.line.focused):hover .line:not(.focused) {
604
604
  }
605
605
  }
606
606
 
607
- .prose :not(pre) > code {
607
+ .prose :not(pre) > code:not(:where([class~="not-prose"] *)) {
608
608
  background: var(--blume-code-background);
609
609
  padding: 0.15em 0.35em;
610
610
  border-radius: 0.3rem;