Skip to content

Commit

Permalink
chore: moved to using a LandingLayout for the landing page to isolate…
Browse files Browse the repository at this point in the history
… different facets of me
  • Loading branch information
justin1dennison committed Nov 25, 2024
1 parent 0951482 commit ebb9f0d
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 3 deletions.
25 changes: 25 additions & 0 deletions src/layouts/LandingLayout.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
import { ViewTransitions } from "astro:transitions";
import BaseHead from "@components/BaseHead.astro";
interface Props {
title: string;
}
const {title} = Astro.props;
---

<!doctype html>
<html lang="en" class="antialiased break-words">
<head>
<BaseHead {title} />
<script>
if (localStorage.theme === "dark") {
document.documentElement.classList.add("dark");
}
</script>
<ViewTransitions />
</head>
<body>
<slot />
</body>
</html>
6 changes: 3 additions & 3 deletions src/pages/index.astro
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
---
import Layout from "@layouts/Layout.astro";
import LandingLayout from "@layouts/LandingLayout.astro";
const baseUrl = import.meta.env.BASE_URL;
---

<Layout title="Welcome to JD.">
<LandingLayout title="Who is Justin Dennison?">
<main>
<h1>Welcome to <span class="text-gradient">JD's</span> page.</h1>
</main>
<ul>
<li><a href={`${baseUrl}/posts`}>Blog Posts</a></li>
</ul>
</Layout>
</LandingLayout>

0 comments on commit ebb9f0d

Please sign in to comment.