chore: middleware

This commit is contained in:
Cory Dransfeldt 2024-11-17 09:08:15 -08:00
parent 45b6e113b5
commit 3ab6f77a69
No known key found for this signature in database
18 changed files with 180 additions and 36 deletions

View file

@ -9,15 +9,15 @@ const currentUrl = Astro.url.pathname;
const nav = await fetchNavigation();
const {
globals,
schema = "page",
pageTitle,
description,
ogImage,
fullUrl,
updated,
...otherProps
} = Astro.props;
const { globals} = Astro.locals;
const isProduction = import.meta.env.MODE === "production";
---
@ -42,18 +42,15 @@ const isProduction = import.meta.env.MODE === "production";
type="font/woff2"
crossorigin="anonymous"
/>
<Metadata
schema={schema}
globals={globals}
pageTitle={pageTitle}
description={description}
ogImage={ogImage}
fullUrl={fullUrl}
{...otherProps}
/>
<script defer src="/scripts/index.js"></script>
<script defer src="/scripts/index.js" is:inline></script>
{
isProduction && (
<>
@ -72,12 +69,12 @@ const isProduction = import.meta.env.MODE === "production";
<body>
<div class="main-wrapper">
<main>
<Header nav={nav} siteName={globals?.site_name} url={currentUrl} />
<Header siteName={globals?.site_name} url={currentUrl} />
<div class="default-wrapper">
<slot />
</div>
</main>
<Footer nav={nav} />
<Footer updated={updated} />
</div>
</body>
</html>