aboutsummaryrefslogtreecommitdiff
path: root/www-2/src/layouts/ArticlePage.astro
blob: b6ea5d072153be1185824733a693ce718f9ae300 (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
45
46
47
48
49
50
---
import PageBase from "./PageBase.astro";
import Nav from "../components/Nav.astro";

interface Props {
    id: string;
    data: {
        title: string;
        date: Date;
        lastmod?: Date;
    };
}

const {
    id,
    data: { title, date, lastmod },
} = Astro.props;
---

<PageBase>
    <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>