mirror of
https://github.com/prdlk/leetcode.git
synced 2026-11-02 13:12:44 +00:00
docs(docs): add header tabs for Changelog and Appendix pages
This commit is contained in:
1 parent
b5c3f1a159
commit
0e58b63d4d
2 files changed
+9
-33
No files matched your search
@@ -1,17 +1,14 @@
|
||||
---
|
||||
/**
|
||||
* The `Sidebar` slot (also the mobile drawer's nav, which defaults to it): a
|
||||
* Fumadocs-style content-source selector, then the pinned links, then
|
||||
* Blume's own nav tree scoped to 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.
|
||||
* Fumadocs-style content-source selector, then Blume's own nav tree scoped to
|
||||
* the active source (`sources.ts`).
|
||||
*
|
||||
* The selector is a `<details>` with Blume's `data-blume-dropdown` light
|
||||
* dismiss (outside press, Escape, focus leaving), like its own NavSelector.
|
||||
*/
|
||||
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 type { UIStrings } from "blume/core/i18n-ui.ts";
|
||||
import { isUnderPath } from "blume/core/navigation.ts";
|
||||
@@ -26,11 +23,6 @@ interface Props {
|
||||
fragmentBase?: string;
|
||||
}
|
||||
|
||||
const PINNED = [
|
||||
{ label: "Changelog", href: "/changelog", icon: "clock" },
|
||||
{ label: "Appendix", href: "/appendix", icon: "library" },
|
||||
];
|
||||
|
||||
const { items, currentRoute, ...tree } = Astro.props;
|
||||
|
||||
const active =
|
||||
@@ -89,25 +81,6 @@ const scoped =
|
||||
</div>
|
||||
</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} />
|
||||
|
||||
<script>
|
||||
|
||||
Reference in new issue
Block a user