change layout props to use contentLayout instead of contentClass
This commit is contained in:
parent
f354c6c014
commit
c3837ef6c8
4 changed files with 5 additions and 6 deletions
|
|
@ -6,10 +6,11 @@ import Header from "../components/Header.astro";
|
|||
interface Props {
|
||||
title: string;
|
||||
description: string;
|
||||
contentClass?: string;
|
||||
contentLayout?: "default" | "fill-height";
|
||||
}
|
||||
|
||||
const { title, description, contentClass = "" } = Astro.props;
|
||||
const { title, description, contentLayout = "default" } = Astro.props;
|
||||
const contentClass = contentLayout === "fill-height" ? "flex-1" : "py-12";
|
||||
---
|
||||
|
||||
<!doctype html>
|
||||
|
|
@ -24,7 +25,7 @@ const { title, description, contentClass = "" } = Astro.props;
|
|||
</head>
|
||||
<body class="h-screen max-w-5xl mx-auto flex flex-col font-sans">
|
||||
<Header />
|
||||
<div class={`w-full max-w-3xl mx-auto ${contentClass ?? ""}`}>
|
||||
<div class={`w-full max-w-3xl mx-auto ${contentClass}`}>
|
||||
<slot />
|
||||
</div>
|
||||
<Footer />
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import Layout from "../layouts/Layout.astro";
|
|||
---
|
||||
|
||||
<Layout
|
||||
contentClass="flex-1"
|
||||
contentLayout="fill-height"
|
||||
title="Dhemas Nurjaya"
|
||||
description="Welcome to my personal website"
|
||||
>
|
||||
|
|
|
|||
|
|
@ -22,7 +22,6 @@ const renderedPost = await render(post);
|
|||
---
|
||||
|
||||
<Layout
|
||||
contentClass="py-12"
|
||||
title={`${post.data.title} - Dhemas Nurjaya`}
|
||||
description={post.data.description}
|
||||
>
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@ posts.sort((a, b) => b.data.date.getTime() - a.data.date.getTime());
|
|||
---
|
||||
|
||||
<Layout
|
||||
contentClass="py-12"
|
||||
title="Posts - Dhemas Nurjaya"
|
||||
description="Read the latest blog posts by Dhemas Nurjaya"
|
||||
>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue