mirror of
https://github.com/anomalyco/opencode.git
synced 2026-08-24 23:01:34 -04:00
fix(www): update docs section navigation (#44753)
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
---
|
||||
import { docsHref, docsSections } from "../lib/navigation"
|
||||
import { docsHref, docsSections, getDocsSection } from "../lib/navigation"
|
||||
|
||||
interface Props {
|
||||
currentSlug: string
|
||||
}
|
||||
|
||||
const currentSlug = Astro.props.currentSlug
|
||||
const currentSection = getDocsSection(currentSlug)
|
||||
const searchEnabled = import.meta.env.PROD
|
||||
---
|
||||
|
||||
@@ -17,7 +18,7 @@ const searchEnabled = import.meta.env.PROD
|
||||
<nav aria-label="Documentation sections">
|
||||
{
|
||||
docsSections.map((section) => (
|
||||
<a href={docsHref(section.landingSlug)} aria-current={currentSlug === section.key || currentSlug.startsWith(`${section.key}/`) || (section.key === "docs" && !currentSlug.includes("/") && currentSlug !== "api") ? "page" : undefined}>
|
||||
<a href={docsHref(section.landingSlug)} aria-current={currentSection.key === section.key ? "page" : undefined}>
|
||||
{section.title}
|
||||
</a>
|
||||
))
|
||||
|
||||
@@ -60,12 +60,12 @@ export const docsSections: DocsSection[] = [
|
||||
{
|
||||
key: "cli",
|
||||
title: "CLI",
|
||||
landingSlug: "cli/index",
|
||||
landingSlug: "cli",
|
||||
groups: [
|
||||
{
|
||||
title: "Intro",
|
||||
items: [
|
||||
{ title: "Intro", slug: "cli/index" },
|
||||
{ title: "Intro", slug: "cli" },
|
||||
{ title: "Config", slug: "cli/config" },
|
||||
],
|
||||
},
|
||||
@@ -85,13 +85,13 @@ export const docsSections: DocsSection[] = [
|
||||
{
|
||||
key: "build",
|
||||
title: "Build",
|
||||
landingSlug: "build/index",
|
||||
landingSlug: "build",
|
||||
groups: [
|
||||
{
|
||||
title: "Build",
|
||||
items: [
|
||||
{ title: "SDK", slug: "build/sdk" },
|
||||
{ title: "Build", slug: "build/index" },
|
||||
{ title: "Build", slug: "build" },
|
||||
{ title: "Client", slug: "build/client" },
|
||||
{ title: "Plugins", slug: "build/plugins" },
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user