summaryrefslogtreecommitdiff
path: root/src/components/NavLinks.astro
diff options
context:
space:
mode:
authorJoe Carstairs <jcarstairs@scottlogic.com>2023-08-15 20:23:31 +0100
committerJoe Carstairs <jcarstairs@scottlogic.com>2023-08-15 20:23:31 +0100
commitc728854bd06f2610b2e0ec30af6d2f08e9c3f4cb (patch)
tree54e236fcef276ea458a8b3a669679321b96babb3 /src/components/NavLinks.astro
parent124486696f361783e5f24854b3fecd22c63632d9 (diff)
Adds nav links
Diffstat (limited to 'src/components/NavLinks.astro')
-rw-r--r--src/components/NavLinks.astro25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/components/NavLinks.astro b/src/components/NavLinks.astro
new file mode 100644
index 0000000..a34014e
--- /dev/null
+++ b/src/components/NavLinks.astro
@@ -0,0 +1,25 @@
+---
+import getLocaleFromPath from '$lib/getLocaleFromPath';
+import translate from '$i18n/translate';
+import tNews from '$i18n/translations/pages/news';
+import tFurthsettins from '$i18n/translations/pages/furthsettins';
+import tHame from '$i18n/translations/pages/home';
+
+const locale = getLocaleFromPath(Astro.url.pathname);
+const t = translate(locale);
+---
+
+<ul class="nav__nav-links">
+ <li>
+ <a class="btn" href={`/${locale}/news`}>{t(tNews, { key: 'title' })}</a>
+ </li>
+ <li>
+ <a class="btn" href={`/${locale}/furthsettins`}>{t(tFurthsettins, { key: 'title' })}</a>
+ </li>
+ <li>
+ <a class="btn" href={`/${locale}/#jyne`}>{t(tHame, { key: 'jyne' })}</a>
+ </li>
+ <li>
+ <a class="btn" href={`/${locale}/#contact`}>{t(tHame, { key: 'contact' })}</a>
+ </li>
+</ul>