-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathContentLayout.astro
More file actions
83 lines (77 loc) · 1.71 KB
/
ContentLayout.astro
File metadata and controls
83 lines (77 loc) · 1.71 KB
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
---
/*
This layout is used in pages that render markdoc content
- pages/blog/[slug].astro
*/
// Import the global.css file here so that it is included on
import "../styles/global.css";
import "../styles/markdown.css";
import Header from "../components/Header.astro";
import Footer from "../components/Footer.astro";
import Favicon from "./Favicon.astro";
export interface Props {
title: string;
date: Date;
}
const { title, date } = Astro.props;
const formattedDate = new Date(date).toLocaleDateString("en-us", {
year: "numeric",
month: "short",
day: "numeric",
});
---
<!DOCTYPE html>
<html class="theme-sleek" lang="en">
<head>
<!-- Global Metadata -->
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<Favicon />
<slot name="meta" />
</head>
<body class="text-text-body bg-bg-body max-w-3xl mx-auto px-4 sm:px-8">
<Header />
<main id="main">
<section class="post">
<h1 class="title">{title}</h1>
<time class="publish-date">{formattedDate}</time>
<slot name="alert" />
<slot name="content" />
<slot name="license" />
</section>
</main>
<Footer />
<style>
body {
display: grid;
min-height: 100vh;
grid-template-areas:
"header"
"main"
"footer";
grid-template-rows: 5rem minmax(0, 1fr) 5rem;
grid-template-columns: minmax(0, 1fr);
}
main {
grid-area: main;
}
</style>
<style>
.title {
font-size: 2.5em;
line-height: 1.2 !important;
margin: 0.25em 0 0;
}
.publish-date {
font-size: 0.875em;
color: var(--text-muted);
margin-bottom: 2rem;
display: block;
}
hr {
border-top: 1px solid #ddd;
margin: 1rem 0;
}
</style>
</body>
</html>