main
 1#import "components/align.typ": center, left, right
 2#import "components/frame.typ": frame
 3#import "components/fullwidth.typ": fullwidth
 4#import "components/marginnote.typ": marginnote
 5#import "components/ruby.typ": ruby
 6
 7#let post-template(body, lang: "en", region: none) = {
 8  set text(lang: lang, region: region)
 9
10  import "./mathyml/src/lib.typ": to-mathml
11
12  import "./templates/blockquote.typ": blockquote-template
13  import "./templates/font.typ": font-template
14  import "./templates/footnote.typ": footnote-template
15  import "./templates/heading.typ": heading-template
16  import "./templates/raw.typ": raw-template
17
18  show math.equation: to-mathml
19
20  show: blockquote-template
21  show: font-template
22  show: footnote-template
23  show: heading-template
24  show: raw-template
25
26  context {
27    let frontmatter = query(<frontmatter>).first(default: (value: (title: "", date: auto))).value
28    set document(
29      title: frontmatter.title,
30      date: frontmatter.date,
31      description: frontmatter.at("desc", default: none),
32    )
33    if frontmatter.title != "" { title() }
34  }
35
36  body
37}