From 9cefd6525a79e99a7f5e73d80aafb6efd81df8ed Mon Sep 17 00:00:00 2001 From: Jean-Marie 'Histausse' Mineau Date: Wed, 18 Mar 2026 14:12:02 +0100 Subject: [PATCH] make header optionnal --- lib/html_body.typ | 18 ++++++++---------- lib/main.typ | 2 +- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/lib/html_body.typ b/lib/html_body.typ index e32c5f7..135d342 100644 --- a/lib/html_body.typ +++ b/lib/html_body.typ @@ -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 }) }) diff --git a/lib/main.typ b/lib/main.typ index 3d98c26..b54f5f6 100644 --- a/lib/main.typ +++ b/lib/main.typ @@ -12,7 +12,7 @@ /// Title of the page, default to document.title title: none, /// Page header - header: [], + header: none, /// Use only for html 'lang' attribute. lang: "en", //-- only args --