---
import Header from "~/components/astro/header.astro"
import Navigation from "~/components/astro/nav.astro"
import BaseLayout from "~/layouts/base.astro"

const { title, description, ogImage } = Astro.props
const filename = Astro.url.pathname.split("/").filter(Boolean).pop() ?? ""
const openGraphImage = !ogImage ? `/og/${filename}.png` : ogImage
---

<BaseLayout title={title} description={description} ogImage={openGraphImage}>
  <main class="max-auto mb-10 w-full max-w-3xl">
    <div class="relative z-10">
      <Header />
      <Navigation />
      <slot />
    </div>
  </main>
</BaseLayout>
