make header optionnal

This commit is contained in:
Jean-Marie 'Histausse' Mineau 2026-03-18 14:12:02 +01:00
parent 07a0392d8c
commit 9cefd6525a
Signed by: histausse
GPG key ID: B66AEEDA9B645AD2
2 changed files with 9 additions and 11 deletions

View file

@ -6,7 +6,7 @@
/// Make the body of the webpage /// Make the body of the webpage
#let html_body( #let html_body(
/// The visible header of the page /// The visible header of the page
header: [], header: none,
/// Logo of the site /// Logo of the site
logo: none, logo: none,
/// Navigation menu content, css style expect a list /// Navigation menu content, css style expect a list
@ -72,16 +72,14 @@
if menu != none { if menu != none {
nav-menu(menu) nav-menu(menu)
} }
if header != none or logo != none {
html.header(style: "display: flex; flex-wrap: wrap-reverse;", { html.header(style: "display: flex; flex-wrap: wrap-reverse;", {
html.hgroup({ html.hgroup({
header header
}) })
// typst `image` function embed the image in the html, which is not great,
// and logo is also used for icon, so it's necessarily an url
if logo != none {
logo logo
}
}) })
}
body body
}) })
}) })

View file

@ -12,7 +12,7 @@
/// Title of the page, default to document.title /// Title of the page, default to document.title
title: none, title: none,
/// Page header /// Page header
header: [], header: none,
/// Use only for html 'lang' attribute. /// Use only for html 'lang' attribute.
lang: "en", lang: "en",
//-- <head> only args -- //-- <head> only args --