From 3e18a85d26b77fad8def1fd4a60e780743144cce Mon Sep 17 00:00:00 2001 From: Jean-Marie 'Histausse' Mineau Date: Wed, 18 Mar 2026 14:33:31 +0100 Subject: [PATCH] add footer --- lib/html_body.typ | 28 +++++++++++++++++++++++++++- lib/main.typ | 11 +++++++---- test_template/main.typ | 6 +++++- 3 files changed, 39 insertions(+), 6 deletions(-) diff --git a/lib/html_body.typ b/lib/html_body.typ index 135d342..d5e4d1c 100644 --- a/lib/html_body.typ +++ b/lib/html_body.typ @@ -7,6 +7,8 @@ #let html_body( /// The visible header of the page header: none, + /// The footer of the page + footer: none, /// Logo of the site logo: none, /// Navigation menu content, css style expect a list @@ -15,7 +17,14 @@ ) = { theme-colors-css ```raw-css + + html, body { + height: 100%; + margin: 0; + } + site-wrapper { + height: 100%; display: flex; flex-wrap: wrap; width: 100%; @@ -33,6 +42,8 @@ } site-container { + display: flex; + flex-direction: column; width: 1050px; padding: 0 20px; @@ -45,6 +56,16 @@ border-bottom: solid 1px var(--color-border); margin-top: 15px; } + + main { + flex: 1; + } + + footer { + border-top: solid 1px var(--color-border); + padding: 15px 5px; + margin-top: 15px; + } } code-block { @@ -80,7 +101,12 @@ logo }) } - body + + html.main(body) + + if footer != none { + html.footer(footer) + } }) }) }) diff --git a/lib/main.typ b/lib/main.typ index b54f5f6..59f85a7 100644 --- a/lib/main.typ +++ b/lib/main.typ @@ -7,12 +7,8 @@ #let webpage( /// Page url url, - /// Logo in page header - logo: none, /// Title of the page, default to document.title title: none, - /// Page header - header: none, /// Use only for html 'lang' attribute. lang: "en", //-- only args -- @@ -34,6 +30,12 @@ /// 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 ) = { @@ -53,6 +55,7 @@ html_body( logo: logo, header: header, + footer: footer, menu: menu, body ) diff --git a/test_template/main.typ b/test_template/main.typ index 2af40f5..7f55e60 100644 --- a/test_template/main.typ +++ b/test_template/main.typ @@ -17,6 +17,10 @@ = Test TeTyTe Hello World! ], + footer: [ + #sym.copyright 2026 Histausse + Please don't train AI on my stuff without explicit permission + ], menu: [ - #link("example.com")[Hello Void!] - #link("example.com")[Demons] @@ -34,7 +38,7 @@ ) -#lorem(200) +#lorem(400) Test, `this is not a code block`, end test.