diff --git a/lib/html_body.typ b/lib/html_body.typ index 2653552..e32c5f7 100644 --- a/lib/html_body.typ +++ b/lib/html_body.typ @@ -7,10 +7,8 @@ #let html_body( /// The visible header of the page header: [], - /// Logo of the site, must be an url (TODO) - logo, - /// Logo alt-text - logo_alt, + /// Logo of the site + logo: none, /// Navigation menu content, css style expect a list menu: none, body @@ -81,7 +79,7 @@ // 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 { - html.img(src: logo, alt: logo_alt, height: 100) // TODO: height bad + logo } }) body diff --git a/lib/html_head.typ b/lib/html_head.typ index 5722ccf..1535bd2 100644 --- a/lib/html_head.typ +++ b/lib/html_head.typ @@ -8,7 +8,7 @@ /// Title of the page title, /// Path to the icon (TODO: /!\ must be an url, typst image not yet supported) - icon, + icon: none, /// Type of the page for open-graph data og-type: "website", /// Name of the site for metadata of the page diff --git a/lib/main.typ b/lib/main.typ index 6a70889..3d98c26 100644 --- a/lib/main.typ +++ b/lib/main.typ @@ -7,10 +7,8 @@ #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, + /// Logo in page header + logo: none, /// Title of the page, default to document.title title: none, /// Page header @@ -18,6 +16,8 @@ /// Use only for html 'lang' attribute. lang: "en", //-- only args -- + /// Website icon, *needs* to be path (TODO: fix when typst support multi-file out) + icon: none, /// Type of the page for open-graph data og-type: "website", /// Name of the site for metadata of the page @@ -31,7 +31,8 @@ /// List of related sites for metadata me-links: (), //-- Body -- - /// Navigation menu content, css style expect a list + /// Navigation menu content, css style expect a list of links, but it can + /// be anything menu: none, /// Body of the page body @@ -41,7 +42,7 @@ html_head( url, title, - logo, + icon: icon, og-type: og-type, site-name: site-name, description: description, @@ -50,8 +51,7 @@ me-links: me-links ) html_body( - logo, - logo-alt, + logo: logo, header: header, menu: menu, body diff --git a/test_template/main.typ b/test_template/main.typ index 5c092f1..2af40f5 100644 --- a/test_template/main.typ +++ b/test_template/main.typ @@ -8,8 +8,11 @@ #show: webpage.with( "http://test.example.com", - "https://jean-marie.mineau.eu/website_assets/platypus.png", - "A drawing of a blue-ish round-ish platypus with big eyes, holding a laptop. This platypus is quite cute, but I might be biased.", + logo: image( + "./platypus.png", + alt: "A drawing of a blue-ish round-ish platypus with big eyes, holding a laptop. This platypus is quite cute, but I might be biased.", + height: 100pt, + ), header: [ = Test TeTyTe Hello World! @@ -27,6 +30,7 @@ - #link("example.com")[War] ], site-name: "TTT", + icon: "https://jean-marie.mineau.eu/website_assets/platypus.png", ) diff --git a/test_template/platypus.png b/test_template/platypus.png new file mode 100644 index 0000000..2277498 Binary files /dev/null and b/test_template/platypus.png differ