From 5240bf9be8ec655779212d556f1d74cc9f319f5d Mon Sep 17 00:00:00 2001 From: Stefan Imhoff Date: Thu, 23 Feb 2023 19:53:03 +0100 Subject: [PATCH] feat(astro): add navigation component --- src/components/MainNavigation.astro | 28 ++++++++++++++++++++++++++++ src/data/navigation.json | 18 ++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 src/components/MainNavigation.astro create mode 100644 src/data/navigation.json diff --git a/src/components/MainNavigation.astro b/src/components/MainNavigation.astro new file mode 100644 index 0000000..c1769c4 --- /dev/null +++ b/src/components/MainNavigation.astro @@ -0,0 +1,28 @@ +--- +import navigation from '../data/navigation.json'; + +const currentPath = new URL(Astro.request.url).pathname; +--- + + diff --git a/src/data/navigation.json b/src/data/navigation.json new file mode 100644 index 0000000..7c5c807 --- /dev/null +++ b/src/data/navigation.json @@ -0,0 +1,18 @@ +[ + { + "title": "Home", + "url": "/" + }, + { + "title": "About", + "url": "/about/" + }, + { + "title": "Journal", + "url": "/journal/" + }, + { + "title": "Projects", + "url": "/projects/" + } +]