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 {
|
interface Props {
|
||||||
title: string;
|
title: string;
|
||||||
description: 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>
|
<!doctype html>
|
||||||
|
|
@ -24,7 +25,7 @@ const { title, description, contentClass = "" } = Astro.props;
|
||||||
</head>
|
</head>
|
||||||
<body class="h-screen max-w-5xl mx-auto flex flex-col font-sans">
|
<body class="h-screen max-w-5xl mx-auto flex flex-col font-sans">
|
||||||
<Header />
|
<Header />
|
||||||
<div class={`w-full max-w-3xl mx-auto ${contentClass ?? ""}`}>
|
<div class={`w-full max-w-3xl mx-auto ${contentClass}`}>
|
||||||
<slot />
|
<slot />
|
||||||
</div>
|
</div>
|
||||||
<Footer />
|
<Footer />
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ import Layout from "../layouts/Layout.astro";
|
||||||
---
|
---
|
||||||
|
|
||||||
<Layout
|
<Layout
|
||||||
contentClass="flex-1"
|
contentLayout="fill-height"
|
||||||
title="Dhemas Nurjaya"
|
title="Dhemas Nurjaya"
|
||||||
description="Welcome to my personal website"
|
description="Welcome to my personal website"
|
||||||
>
|
>
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,6 @@ const renderedPost = await render(post);
|
||||||
---
|
---
|
||||||
|
|
||||||
<Layout
|
<Layout
|
||||||
contentClass="py-12"
|
|
||||||
title={`${post.data.title} - Dhemas Nurjaya`}
|
title={`${post.data.title} - Dhemas Nurjaya`}
|
||||||
description={post.data.description}
|
description={post.data.description}
|
||||||
>
|
>
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,6 @@ posts.sort((a, b) => b.data.date.getTime() - a.data.date.getTime());
|
||||||
---
|
---
|
||||||
|
|
||||||
<Layout
|
<Layout
|
||||||
contentClass="py-12"
|
|
||||||
title="Posts - Dhemas Nurjaya"
|
title="Posts - Dhemas Nurjaya"
|
||||||
description="Read the latest blog posts by Dhemas Nurjaya"
|
description="Read the latest blog posts by Dhemas Nurjaya"
|
||||||
>
|
>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue