From 9ccd24e10f7f2387a5a8f841f7f496bbb8389e81 Mon Sep 17 00:00:00 2001 From: Sebastian Beltran Date: Tue, 20 Aug 2024 11:46:17 -0500 Subject: [PATCH 1/5] add items to menu nav --- astro.config.mts | 3 ++ astro/components/SiteTitle.astro | 76 ++++++++++++++++++++++++++++++++ 2 files changed, 79 insertions(+) create mode 100644 astro/components/SiteTitle.astro diff --git a/astro.config.mts b/astro.config.mts index cb3c755..058cbb4 100644 --- a/astro.config.mts +++ b/astro.config.mts @@ -63,6 +63,9 @@ export default defineConfig({ ], }, ], + components: { + SiteTitle: './astro/components/SiteTitle.astro', + }, favicon: './public/favicon-32x32.png', logo: { light: './astro/assets/logo-light.svg', diff --git a/astro/components/SiteTitle.astro b/astro/components/SiteTitle.astro new file mode 100644 index 0000000..de66a8c --- /dev/null +++ b/astro/components/SiteTitle.astro @@ -0,0 +1,76 @@ +--- +import AstrolightSiteTitle from "@astrojs/starlight/components/SiteTitle.astro"; +import type { Props } from "@astrojs/starlight/props"; + +const menuItems = [ + { name: "Docs", href: "/introduction" }, + { name: "Performance", href: "/performance" }, + { name: "Playground", href: "/playground" }, +]; + +function pathsMatch(pathA: string, pathB: string): boolean { + return pathB.includes(pathA); +} +--- + +
+ + +
+ + +
+ + \ No newline at end of file From b70804bbabb52fc98f8981b1cb2849aa7b654997 Mon Sep 17 00:00:00 2001 From: Sebastian Beltran Date: Tue, 20 Aug 2024 11:51:04 -0500 Subject: [PATCH 2/5] fix code style --- astro/components/SiteTitle.astro | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/astro/components/SiteTitle.astro b/astro/components/SiteTitle.astro index de66a8c..48e56c1 100644 --- a/astro/components/SiteTitle.astro +++ b/astro/components/SiteTitle.astro @@ -1,15 +1,15 @@ --- -import AstrolightSiteTitle from "@astrojs/starlight/components/SiteTitle.astro"; -import type { Props } from "@astrojs/starlight/props"; +import AstrolightSiteTitle from '@astrojs/starlight/components/SiteTitle.astro' +import type { Props } from '@astrojs/starlight/props' const menuItems = [ - { name: "Docs", href: "/introduction" }, - { name: "Performance", href: "/performance" }, - { name: "Playground", href: "/playground" }, -]; + { name: 'Docs', href: '/introduction' }, + { name: 'Performance', href: '/performance' }, + { name: 'Playground', href: '/playground' }, +] function pathsMatch(pathA: string, pathB: string): boolean { - return pathB.includes(pathA); + return pathB.includes(pathA) } --- From f5cdb49993c095517f1dfcd63250824937f684fc Mon Sep 17 00:00:00 2001 From: Sebastian Beltran Date: Tue, 20 Aug 2024 11:55:34 -0500 Subject: [PATCH 3/5] remove class --- astro/components/SiteTitle.astro | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/astro/components/SiteTitle.astro b/astro/components/SiteTitle.astro index 48e56c1..4719b48 100644 --- a/astro/components/SiteTitle.astro +++ b/astro/components/SiteTitle.astro @@ -16,9 +16,9 @@ function pathsMatch(pathA: string, pathB: string): boolean {
-
+
-