diff --git a/src/layouts/Footer.astro b/src/layouts/Footer.astro index 7072c99..cfe1c44 100644 --- a/src/layouts/Footer.astro +++ b/src/layouts/Footer.astro @@ -8,7 +8,6 @@ import config from '@config'; import NavBar from '@layouts/NavBar.astro'; import { getCustomNavbar, getDefaultNavbar, getPages } from '@utils/nav'; import { toBackgroundClass } from '@utils/pageBuilder'; -import { getCurrentURL, setCacheControl } from '@utils/url'; import clsx from 'clsx'; import _ from 'underscore'; @@ -18,6 +17,7 @@ const { customContent, login, logos, + pathname, privacyUrl, termsUrl, title @@ -26,7 +26,6 @@ const { const year = new Date().getFullYear(); const currentLocale = Astro.currentLocale; -const currentUrl = getCurrentURL(Astro.request.headers); const [{ t }, navbar, pages] = await Promise.all([ getTranslations(currentLocale), @@ -37,13 +36,11 @@ const [{ t }, navbar, pages] = await Promise.all([ let items; if (navbar && navbar.items) { - items = getCustomNavbar(navbar, currentLocale, currentUrl.pathname); + items = getCustomNavbar(navbar, currentLocale, pathname); } else { - items = getDefaultNavbar(pages, currentLocale, currentUrl.pathname, t); + items = getDefaultNavbar(pages, currentLocale, pathname, t); } -setCacheControl(Astro.response.headers); - --- { !custom && ( diff --git a/src/layouts/Header.astro b/src/layouts/Header.astro index f54b73c..d3692fa 100644 --- a/src/layouts/Header.astro +++ b/src/layouts/Header.astro @@ -1,78 +1,56 @@ --- -import { getTranslations } from '@backend/i18n'; -import { fetchNavbar } from '@backend/tina'; -import LanguagePicker from '@components/LanguagePicker'; -import MobileHeader from '@components/MobileHeader'; -import NavBar from '@layouts/NavBar.astro'; -import { getCustomNavbar, getDefaultNavbar, getPages } from '@utils/nav'; -import { getCurrentURL, setCacheControl } from '@utils/url'; -import { getRelativeLocaleUrl, getRelativeLocaleUrlList } from 'astro:i18n'; -import clsx from 'clsx'; +import { getTranslations } from "@backend/i18n"; +import { fetchNavbar } from "@backend/tina"; +import LanguagePicker from "@components/LanguagePicker"; +import MobileHeader from "@components/MobileHeader"; +import NavBar from "@layouts/NavBar.astro"; +import { getCustomNavbar, getDefaultNavbar, getPages } from "@utils/nav"; +import { getRelativeLocaleUrl, getRelativeLocaleUrlList } from "astro:i18n"; +import clsx from "clsx"; const locales = getRelativeLocaleUrlList(); const currentLocale = Astro.currentLocale; -const currentUrl = getCurrentURL(Astro.request.headers); -const { - fullscreen, - image, - imageAlt, - title, - transparent -} = Astro.props; +const { fullscreen, image, imageAlt, pathname, title, transparent } = + Astro.props; const [{ t }, navbar, pages] = await Promise.all([ getTranslations(currentLocale), fetchNavbar(currentLocale), - getPages(currentLocale) + getPages(currentLocale), ]); let items; if (navbar && navbar.items) { - items = getCustomNavbar(navbar, currentLocale, currentUrl.pathname); + items = getCustomNavbar(navbar, currentLocale, pathname); } else { - items = getDefaultNavbar(pages, currentLocale, currentUrl.pathname, t); + items = getDefaultNavbar(pages, currentLocale, pathname, t); } - -setCacheControl(Astro.response.headers); - ---
@@ -87,7 +65,7 @@ setCacheControl(Astro.response.headers);