Skip to content

BaseLayout

BaseLayout is the foundation that all other layouts extend. It provides the HTML document structure and core functionality.

PropTypeDefaultDescription
titlestringPage title (required)
descriptionstringMeta description
imagestringOG image URL
imageAltstringOG image alt text
articleobjectArticle metadata
noindexbooleanfalsePrevent search indexing
nofollowbooleanfalsePrevent link following
includeOrgSchemabooleanfalseInclude Organization JSON-LD
interface ArticleMetadata {
publishedTime?: string;
modifiedTime?: string;
authors?: string[];
tags?: string[];
}
SlotPurpose
headerHeader component placement
defaultMain page content
footerFooter component placement
---
import BaseLayout from '@/layouts/BaseLayout.astro';
import Header from '@/components/layout/Header.astro';
import Footer from '@/components/layout/Footer.astro';
---
<BaseLayout
title="Page Title"
description="Page description"
>
<Header slot="header" />
<main>
<!-- Your content -->
</main>
<Footer slot="footer" />
</BaseLayout>

Google Fonts are preconnected and loaded:

  • Outfit — Primary sans-serif
  • Manrope — Secondary sans-serif
  • JetBrains Mono — Monospace for code

Automatically includes the SEO component with:

  • Title and description meta tags
  • Open Graph tags
  • Twitter Card tags
  • Canonical URL

Optional structured data:

<BaseLayout
title="Home"
includeOrgSchema
>
<!-- Includes Organization schema -->
</BaseLayout>

Prevents flash of incorrect theme:

<script is:inline>
// Runs before paint to set .dark class
</script>

If configured, includes:

  • Google Analytics
  • Google Tag Manager

To add global elements, edit BaseLayout.astro:

<head>
<!-- Add custom fonts, scripts, etc. -->
</head>
<body>
<slot name="header" />
<slot />
<slot name="footer" />
<!-- Add global modals, toast containers, etc. -->
</body>