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
#let html_body(
/// The visible header of the page
header: [],
header: none,
/// Logo of the site
logo: none,
/// Navigation menu content, css style expect a list
@ -72,16 +72,14 @@
if menu != none {
nav-menu(menu)
}
html.header(style: "display: flex; flex-wrap: wrap-reverse;", {
html.hgroup({
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 {
if header != none or logo != none {
html.header(style: "display: flex; flex-wrap: wrap-reverse;", {
html.hgroup({
header
})
logo
}
})
})
}
body
})
})