diff options
Diffstat (limited to 'src/layouts/Layout.astro')
| -rw-r--r-- | src/layouts/Layout.astro | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/layouts/Layout.astro b/src/layouts/Layout.astro index 9bca7e1..54b8c25 100644 --- a/src/layouts/Layout.astro +++ b/src/layouts/Layout.astro @@ -3,14 +3,14 @@ import Footer from '$components/Footer.astro'; import Navbar from '$components/Navbar.astro'; import translate from '$i18n/translate'; import site from '$i18n/translations/site'; -import type Locale from '$types/Locale'; +import getLocaleFromPath from '$lib/getLocaleFromPath'; interface Props { - locale: Locale; title: string; } -const { locale, title } = Astro.props; +const { title } = Astro.props; +const locale = getLocaleFromPath(Astro.url.pathname); const t = translate(locale); --- @@ -27,7 +27,7 @@ const t = translate(locale); <title>{title} | {t(site, { key: 'title' })}</title> </head> <body> - <Navbar locale={locale} /> + <Navbar /> <slot /> <Footer /> </body> |
