63 lines
1.5 KiB
Typst
63 lines
1.5 KiB
Typst
#import "./html_head.typ": html_head
|
|
#import "./html_body.typ": html_body
|
|
#import "./html_utils.typ": html_show
|
|
|
|
|
|
/// Mail template function
|
|
#let webpage(
|
|
/// Page url
|
|
url,
|
|
/// Title of the page, default to document.title
|
|
title: none,
|
|
/// Use only for html 'lang' attribute.
|
|
lang: "en",
|
|
//-- <head> only args --
|
|
/// Website icon, *needs* to be path (TODO: fix when typst support multi-file out)
|
|
icon: none,
|
|
/// Type of the page for open-graph data
|
|
og-type: "website",
|
|
/// Name of the site for metadata of the page
|
|
site-name: none,
|
|
/// Description of the site for metadata, default to document.description
|
|
description: none,
|
|
/// Author of the site for metadata, default to document.author
|
|
author: none,
|
|
/// Additional stylesheet for the page: must be a list of url
|
|
stylesheets: (),
|
|
/// List of related sites for metadata
|
|
me-links: (),
|
|
//-- Body --
|
|
/// Navigation menu content, css style expect a list of links, but it can
|
|
/// be anything
|
|
menu: none,
|
|
/// Logo in page header
|
|
logo: none,
|
|
/// Page header
|
|
header: none,
|
|
/// Page footer
|
|
footer: none,
|
|
/// Body of the page
|
|
body
|
|
) = {
|
|
show: html_show
|
|
html.html(lang: lang, {
|
|
html_head(
|
|
url,
|
|
title,
|
|
icon: icon,
|
|
og-type: og-type,
|
|
site-name: site-name,
|
|
description: description,
|
|
author: author,
|
|
stylesheets: stylesheets,
|
|
me-links: me-links
|
|
)
|
|
html_body(
|
|
logo: logo,
|
|
header: header,
|
|
footer: footer,
|
|
menu: menu,
|
|
body
|
|
)
|
|
})
|
|
}
|