Commit e64670c
Changed files (2)
src
layouts
pages
src/layouts/BaseLayout.astro
@@ -0,0 +1,24 @@
+---
+interface Props {
+ title?: string;
+}
+
+const { title = "Kerplunk" } = Astro.props;
+---
+<!doctype html>
+<html lang="en">
+ <head>
+ <meta charset="utf-8" />
+ <meta name="viewport" content="width=device-width" />
+ <meta name="generator" content={Astro.generator} />
+
+ <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
+ <link rel="icon" href="/favicon.ico" />
+
+ <title>{title}</title>
+ <meta name="title" content={title} />
+ </head>
+ <body>
+ <slot />
+ </body>
+</html>
src/pages/index.astro
@@ -1,17 +1,6 @@
---
-
+import BaseLayout from "../layouts/BaseLayout.astro";
---
-
-<html lang="en">
- <head>
- <meta charset="utf-8" />
- <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
- <link rel="icon" href="/favicon.ico" />
- <meta name="viewport" content="width=device-width" />
- <meta name="generator" content={Astro.generator} />
- <title>Astro</title>
- </head>
- <body>
- <h1>Astro</h1>
- </body>
-</html>
+<BaseLayout title="Astro">
+ <h1>Astro</h1>
+</BaseLayout>