generated from codesandbox/codesandbox-template-astro
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathMarkdownLayout.astro
34 lines (31 loc) · 964 Bytes
/
MarkdownLayout.astro
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
---
import BaseLayout from "../layouts/BaseLayout.astro";
import Section from "../components/Section.astro";
import { CURRENT_YEAR, SEO_TAGLINE } from "../data/constants";
import AuthorCard from "../components/AuthorCard.astro";
import { getEntryBySlug } from "astro:content";
const { frontmatter } = Astro.props;
const author = await getEntryBySlug("organizers", frontmatter.author);
---
<BaseLayout
title={`JSHeroes ${CURRENT_YEAR} | ${frontmatter.title || SEO_TAGLINE}`}
>
<img
class="block h-[500px] w-full object-cover"
src={frontmatter.banner || "/img/banners/default-with-bear.svg"}
aria-hidden
/>
<main id="main">
<Section variant="light" content="text" class="max-w-none">
{
author && (
<AuthorCard author={author} publishDate={frontmatter.published} />
)
}
<div class="prose">
<h1>{frontmatter.title}</h1>
<slot />
</div>
</Section>
</main>
</BaseLayout>