diff options
Diffstat (limited to 'src/layouts')
| -rw-r--r-- | src/layouts/Layout.astro | 8 | ||||
| -rw-r--r-- | src/layouts/Page.astro | 6 |
2 files changed, 6 insertions, 8 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> diff --git a/src/layouts/Page.astro b/src/layouts/Page.astro index 8e8b5a9..bc7a095 100644 --- a/src/layouts/Page.astro +++ b/src/layouts/Page.astro @@ -1,16 +1,14 @@ --- -import type Locale from '$types/Locale'; import Layout from './Layout.astro'; interface Props { - locale: Locale; title: string; } -const { locale, title } = Astro.props; +const { title } = Astro.props; --- -<Layout locale={locale} title={title}> +<Layout title={title}> <main id="main"> <slot /> </main> |
