blob: 669681ebed1fbc39b8ce3f4f9b2487e13bc5c4ea (
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
36
37
38
39
40
41
42
43
44
|
---
import type { CollectionEntry } from "astro:content";
import PageBase from "./PageBase.astro";
import Nav from "../components/Nav.astro";
type Props = Pick<CollectionEntry<"articles">, "id" | "data">;
const {
data: { title, date, lastmod },
} = Astro.props;
---
<PageBase title={title}>
<Nav />
<h1 class="post-title">{title}</h1>
<hr />
<p class="post-info">
<span class="created">{date.toLocaleString()}</span> |
{
lastmod && (
<span class="last-updated">
Last updated: {lastmod.toLocaleString()}
</span>
)
}
</p>
<slot />
</PageBase>
<style>
.post-info {
margin-block: 0;
font-family: monospace;
font-size: 0.95em;
display: flex;
flex-wrap: wrap;
gap: 1em;
& > .created {
margin-inline-end: auto;
}
}
</style>
|