summaryrefslogtreecommitdiff
path: root/site/common.typ
diff options
context:
space:
mode:
Diffstat (limited to 'site/common.typ')
-rw-r--r--site/common.typ55
1 files changed, 28 insertions, 27 deletions
diff --git a/site/common.typ b/site/common.typ
index 5f41596..a1c2097 100644
--- a/site/common.typ
+++ b/site/common.typ
@@ -52,12 +52,29 @@
}
}
+#let template(title, header, main) = {
+ html.html({
+ html.head({
+ html.meta(charset: "utf-8")
+ html.meta(name: "viewport", content: "width=device-width, initial-scale=1")
+ html.title(title)
+ html.link(rel: "stylesheet", href: static("style.css"))
+ })
+ html.header(header)
+ html.main(main)
+ html.footer[
+ © 2019--2026 Paweł Redman \
+ Text and images are licensed under #link("https://creativecommons.org/licenses/by-sa/4.0/")[CC-BY-SA 4.0] unless noted otherwise.
+ ]
+ })
+}
+
#let post(body, title: none, author: "Paweł Redman", date: none) = {
assert(date != none, message: "missing date")
set document(
title: title,
- author: "Paweł Redman",
+ author: author,
)
set text(lang: "en")
@@ -85,31 +102,15 @@
)) <post-meta>
]
- html.html({
- html.head({
- html.meta(charset: "utf-8")
- html.meta(name: "viewport", content: "width=device-width, initial-scale=1")
- html.title(title)
- html.link(rel: "stylesheet", href: static("style.css"))
- })
-
- html.header({
- html.nav(breadcrumbs())
- })
-
- html.main({
- html.article({
- html.header({
- html.h1(title)
- html.p(id: "author")[by #author, published on #html.time(datetime: date)[#format-date-en(date)]]
- })
-
- body
+ template(
+ title,
+ html.nav(breadcrumbs()),
+ html.article({
+ html.header({
+ html.h1(title)
+ html.p(id: "author")[by #author, published on #html.time(datetime: date)[#format-date-en(date)]]
})
- })
-
- html.footer[
- footer goes here
- ]
- })
+ body
+ }),
+ )
} \ No newline at end of file