diff options
| author | Paweł Redman <pawel.redman@gmail.com> | 2026-06-14 22:19:49 +0200 |
|---|---|---|
| committer | Paweł Redman <pawel.redman@gmail.com> | 2026-06-14 22:19:49 +0200 |
| commit | 62ef3bb5f7915d2326bcc9f351265107425fc087 (patch) | |
| tree | 1a6640f9584afdf9228b082f00416adf519c6b0e /site/common.typ | |
| parent | c9474445c9bbf22f79778acb292ccd79c7b4d1e5 (diff) | |
Index page in Typst
Diffstat (limited to 'site/common.typ')
| -rw-r--r-- | site/common.typ | 55 |
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 |
