--- import { getRelativeLocaleUrl } from "astro:i18n"; import "@pagefind/default-ui/css/ui.css"; import Layout from "@/layouts/Layout.astro"; import Header from "@/components/Header.astro"; import Breadcrumb from "@/components/Breadcrumb.astro"; import Main from "@/components/Main.astro"; import Footer from "@/components/Footer.astro"; import { getAssetPath } from "@/utils/withBase"; import { useTranslations } from "@/i18n"; import config from "@/config"; const locale = Astro.currentLocale ?? config.site.lang; // Redirect to 404 page if `search` feature is not enabled const notFoundUrl = getRelativeLocaleUrl(locale, "404"); if (config.features.search !== "pagefind" && notFoundUrl) { return Astro.rewrite(notFoundUrl); } const backUrl = config.features.showBackButton ? `${Astro.url.pathname}` : getRelativeLocaleUrl(locale, ""); const pagefindBundlePath = getAssetPath("pagefind/"); const t = useTranslations(locale); ---