aboutsummaryrefslogtreecommitdiff
path: root/src/layouts/BlogPost.astro
blob: 628215fbe35b0704afdbdcdb768b01c71280ee33 (plain) (blame)
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
---
import Layout from './Default.astro';
const { title, description, pubDate, tags } = Astro.props;
---

<Layout title=`${title} - Andrew Lee` description={description}>
    <header>
        <h1 class="header-text">{title}</h1>
        <span>{pubDate}</span>
        <div class="tags">
            {tags.map(tag => (
                    <span class="tag"><a href={`/blog/tags/${tag}`}>{tag}</a></span>
            ))}
        </div>
    </header>
    <div class="container">
        <main>
            <slot />
        </main>
    </div>
</Layout>

<style>
    header {
        display: flex;
        flex-direction: column;
        gap: 0.5em;
        margin: 0;
        text-align: center;
        padding: 0 0 1em;
    }

    main {
        background-color: #3B513B;
        padding: 1.2em;
        border-radius: 20px;
    }

    .header-text {
        font-size: 2em;
        margin: 0;
    }

    h2.header-text {
        font-size: 1.5em;
        font-weight: 300;
    }
    .container {
        margin: 1em 10em 1em 10em;
    }

    .tags {
        display: flex;
        flex-direction: row;
        justify-content: center;
        gap: 1em;
    }

    @media (max-width: 992px) {
        .container {
            margin: 10px 20px 10px 20px;
        }
    }

</style>