typst-web-template/lib/main.typ
Jean-Marie 'Histausse' Mineau e7a8cf8a8e
implement css logic for nav menu
2026-03-18 01:24:26 +01:00

60 lines
1.4 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,
/// Page logo, also used for icon, so it *needs* to be path (TODO: fix when typst support multi-file out)
logo,
/// Alt-text for the log
logo-alt,
/// Title of the page, default to document.title
title: none,
/// Page header
header: [],
/// Use only for html 'lang' attribute.
lang: "en",
//-- <head> only args --
/// 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
menu: none,
/// Body of the page
body
) = {
show: html_show
html.html(lang: lang, {
html_head(
url,
title,
logo,
og-type: og-type,
site-name: site-name,
description: description,
author: author,
stylesheets: stylesheets,
me-links: me-links
)
html_body(
logo,
logo-alt,
header: header,
menu: menu,
body
)
})
}