docs(docs): add header tabs for Changelog and Appendix pages

This commit is contained in:
Prad Nukala committed 2026-10-07 13:45:21 -04:00
1 parent b5c3f1a159
commit 0e58b63d4d
2 files changed
+9 -33

No files matched your search

+6 -3
View File
@@ -142,8 +142,11 @@ export default defineConfig({
sidebar: { sidebar: {
display: "flat", // "flat" | "group" | "page" display: "flat", // "flat" | "group" | "page"
}, },
// No `featured`: Blume renders it above the `Sidebar` slot, and the // The two custom pages (pages/*.astro) as header tabs. Neither is a
// content-source selector must sit above the pinned links, so // content folder, so the tabs scope nothing out of the sidebar tree.
// components/SourceSidebar.astro renders both (Changelog, Appendix). tabs: [
{ label: "Changelog", path: "/changelog", icon: "clock" },
{ label: "Appendix", path: "/appendix", icon: "library" },
],
}, },
}); });
+3 -30
View File
@@ -1,17 +1,14 @@
--- ---
/** /**
* The `Sidebar` slot (also the mobile drawer's nav, which defaults to it): a * The `Sidebar` slot (also the mobile drawer's nav, which defaults to it): a
* Fumadocs-style content-source selector, then the pinned links, then * Fumadocs-style content-source selector, then Blume's own nav tree scoped to
* Blume's own nav tree scoped to the active source (`sources.ts`). * the active source (`sources.ts`).
*
* The pinned links live here, not in `navigation.featured`: Blume renders
* featured links above this slot, so the selector could not sit over them.
* *
* The selector is a `<details>` with Blume's `data-blume-dropdown` light * The selector is a `<details>` with Blume's `data-blume-dropdown` light
* dismiss (outside press, Escape, focus leaving), like its own NavSelector. * dismiss (outside press, Escape, focus leaving), like its own NavSelector.
*/ */
import Icon from "blume/components/Icon.astro"; import Icon from "blume/components/Icon.astro";
import { withBase, withMountedBase } from "blume/components/islands/base-path.ts"; import { withMountedBase } from "blume/components/islands/base-path.ts";
import NavTree from "blume/components/layout/NavTree.astro"; import NavTree from "blume/components/layout/NavTree.astro";
import type { UIStrings } from "blume/core/i18n-ui.ts"; import type { UIStrings } from "blume/core/i18n-ui.ts";
import { isUnderPath } from "blume/core/navigation.ts"; import { isUnderPath } from "blume/core/navigation.ts";
@@ -26,11 +23,6 @@ interface Props {
fragmentBase?: string; fragmentBase?: string;
} }
const PINNED = [
{ label: "Changelog", href: "/changelog", icon: "clock" },
{ label: "Appendix", href: "/appendix", icon: "library" },
];
const { items, currentRoute, ...tree } = Astro.props; const { items, currentRoute, ...tree } = Astro.props;
const active = const active =
@@ -89,25 +81,6 @@ const scoped =
</div> </div>
</details> </details>
<nav aria-label="Featured" class="mb-4 border-border border-b pb-4">
<ul class="m-0 list-none p-0">
{
PINNED.map((link) => (
<li>
<a
aria-current={currentRoute === link.href ? "page" : undefined}
class="flex items-center gap-2 rounded-[0.65rem] px-2.5 py-1.5 text-muted-foreground text-sm transition-colors hover:bg-muted hover:text-foreground aria-[current=page]:bg-muted aria-[current=page]:text-foreground"
href={withBase(link.href)}
>
<Icon class="shrink-0" name={link.icon} size={14} />
<span class="flex-1 truncate">{link.label}</span>
</a>
</li>
))
}
</ul>
</nav>
<NavTree {...tree} currentRoute={currentRoute} items={scoped} /> <NavTree {...tree} currentRoute={currentRoute} items={scoped} />
<script> <script>