noway.moe/src/layouts/BlogPost.astro

98 lines
2.9 KiB
Text
Raw Normal View History

2023-12-25 20:01:37 -07:00
---
import type { CollectionEntry } from 'astro:content';
import BaseHead from '../components/BaseHead.astro';
import Header from '../components/Header.astro';
import Footer from '../components/Footer.astro';
import FormattedDate from '../components/FormattedDate.astro';
type Props = CollectionEntry<'blog'>['data'];
const { title, description, pubDate, updatedDate, heroImage } = Astro.props;
---
<html lang="en">
2023-12-25 23:43:59 -07:00
<head>
<BaseHead title={title} description={description} />
2023-12-26 02:24:34 -07:00
<style is:inline>
2023-12-25 23:43:59 -07:00
main {
2023-12-26 02:24:34 -07:00
max-width: 900px;
2023-12-25 23:43:59 -07:00
margin: auto;
}
2023-12-26 02:24:34 -07:00
div.markdown-title {
2023-12-25 23:43:59 -07:00
text-align: center;
2023-12-26 02:24:34 -07:00
margin-bottom: 20px;
2023-12-25 23:43:59 -07:00
}
2023-12-26 02:24:34 -07:00
h1.markdown-title {
font-family: PoetsenOne, var(--font-sans);
font-size: 60px;
2023-12-25 23:43:59 -07:00
}
.hero-image {
width: 100%;
}
.hero-image img {
display: block;
2023-12-26 02:24:34 -07:00
margin: 30px auto;
2023-12-25 23:43:59 -07:00
border-radius: 22px;
filter: drop-shadow(0 4px 6px #000);
}
2023-12-26 02:24:34 -07:00
.prose h1,
.prose h2,
.prose h3,
.prose h4,
.prose h5,
.prose h6 {
margin-top: calc(var(--font-size) / 3);
2023-12-25 23:43:59 -07:00
font-family: PoetsenOne, var(--font-sans);
text-align: left;
}
2023-12-26 02:24:34 -07:00
.prose h1 {
font-size: 60px;
border-bottom: 2px solid #000;
}
.prose h2 {
2023-12-25 23:43:59 -07:00
font-size: 40px;
2023-12-26 02:24:34 -07:00
border-bottom: 1px solid #aaa;
}
.prose h3 {
font-size: 30px;
}
.prose h4, .prose h5, .prose h6 {
font-size: 22px;
2023-12-25 23:43:59 -07:00
}
p {
line-height: 1.5;
font-family: var(--font-sans);
}
</style>
</head>
<body>
<Header />
<main>
<article>
2023-12-26 02:24:34 -07:00
<div class="markdown-title">
<h1 class="markdown-title">{title}</h1>
<div class="date">
<FormattedDate date={pubDate} />
{
updatedDate && (
<div class="last-updated-on">
Last updated on <FormattedDate date={updatedDate} />
</div>
)
}
</div>
2023-12-25 23:43:59 -07:00
</div>
<div class="prose">
2023-12-26 02:24:34 -07:00
<div class="hero-image">
{heroImage && <img width={1020} height={510} src={heroImage} alt="" />}
2023-12-25 23:43:59 -07:00
</div>
<slot />
</div>
</article>
</main>
<Footer />
</body>
2023-12-25 20:01:37 -07:00
</html>