From d8a42ec0a8d582658f1bf96690692c98f92be468 Mon Sep 17 00:00:00 2001 From: Ayo Date: Mon, 29 May 2023 11:03:15 +0200 Subject: [PATCH] feat: dynamic home nav link --- src/components/Nav.astro | 9 ++++++++- src/layouts/Layout.astro | 4 ---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/components/Nav.astro b/src/components/Nav.astro index 11637a1..be5f8b2 100644 --- a/src/components/Nav.astro +++ b/src/components/Nav.astro @@ -9,7 +9,14 @@ export interface Props { links: Array; } -const { links } = Astro.props; +let { links } = Astro.props; + +if (Astro.url.pathname !== "/") { + links = [{ + url: "/", + icon: "home", + }].concat(links); +} ---