moroz.dev

<< Back to index

How to set up a Website layout in Astro

Abstract

This post explains how to set up a simple header/main/footer layout with a “sticky footer” using Astro.

This post builds on the sample project called megane (tag 2025-06-08) from the previous post.

File: src/layouts/Layout.astro

---
interface Props {
  title: string;
}

const { title } = Astro.props;
---

<!doctype html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <title>{title}</title>
  </head>
  <body>
    <slot />
  </body>
</html>