diff --git a/website/src/components/AwesomeGithub/AwesomeGithubNav.astro b/website/src/components/AwesomeGithub/AwesomeGithubNav.astro index 2414bf8f..040793c4 100644 --- a/website/src/components/AwesomeGithub/AwesomeGithubNav.astro +++ b/website/src/components/AwesomeGithub/AwesomeGithubNav.astro @@ -1,4 +1,5 @@ --- +import { CATEGORIES } from "../../lib/catalogue"; import Icon from "./Icon.astro"; interface Props { @@ -9,36 +10,115 @@ interface Props { const { base, pathname } = Astro.props; const navLinks = [ - { href: `${base}`, path: "/", label: "Home", exact: true }, - { href: `${base}c/agents/`, path: "/c/", label: "Catalogue", exact: false }, - { href: `${base}learn/`, path: "/learn", label: "Learn", exact: false }, - { href: `${base}cookbook/`, path: "/cookbook", label: "Cookbook", exact: false }, - { href: `${base}glossary/`, path: "/glossary", label: "Glossary", exact: false }, + { href: `${base}getting-started/`, path: "/getting-started", label: "Getting started" }, + { href: `${base}learn/`, path: "/learn", label: "Learn" }, + { href: `${base}cookbook/`, path: "/cookbook", label: "Cookbook" }, + { href: `${base}glossary/`, path: "/glossary", label: "Glossary" }, + { href: `${base}why/`, path: "/why", label: "Why" }, ]; -const isActive = (linkPath: string, exact: boolean): boolean => { - const normPath = pathname.replace(/\/$/, ""); - const normLink = linkPath.replace(/\/$/, ""); - return exact ? normPath === normLink : normPath === normLink || normPath.startsWith(normLink + "/"); +const isCatActive = (linkPath: string): boolean => { + const norm = pathname.replace(/\/$/, ""); + const lp = linkPath.replace(/\/$/, ""); + return norm === lp || norm.startsWith(lp + "/"); }; --- -
- - - - Awesome - GitHub - - - -