aboutsummaryrefslogtreecommitdiff
path: root/apps/website/src/layouts/BlogPost.astro
blob: 17ff74d0c2735260c6ea031a542c2fb7d32fb4d7 (plain)
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
35
---
import FormattedDate from '@components/base/FormattedDate.astro';
import '@styles/blog.css';
import type { CollectionEntry } from 'astro:content';
import Layout from './Layout.astro';

type Props = CollectionEntry<'blog'>['data'];

const { title, description, publishDate, updatedDate, coverImage } = Astro.props;
---

<Layout title={title} description={description}>
	<article>
		<div class="hero-image">
			{coverImage && <img width={1020} height={510} src={coverImage} alt="Hero Image"/>}
		</div>
		<div class="prose">
			<div class="title">
				<div class="date">
					<FormattedDate date={publishDate}/>
					{
						updatedDate && (
							<div class="last-updated-on">
								Last updated on <FormattedDate date={updatedDate}/>
							</div>
						)
					}
				</div>
				<h1>{title}</h1>
				<hr/>
			</div>
			<slot/>
		</div>
	</article>
</Layout>