start migration to bundle format

This commit is contained in:
Jean-Marie 'Histausse' Mineau 2026-06-17 12:40:20 +02:00
parent 64e270a868
commit 7fe9b99535
Signed by: histausse
GPG key ID: B66AEEDA9B645AD2
13 changed files with 378 additions and 470 deletions

View file

@ -1,7 +1,8 @@
#import "./html_head.typ": html-head
#import "./html_body.typ": html-body
#import "./html_utils.typ": html-show
#import "./html_utils.typ": html-show, reset-page-states
#import "./summary.typ": summary, card-list
#import "./states.typ": current-page-label
#import "./pyscript.typ": state-use-pyscript, state-pyscript-data-list, state-pyscript-version, state-pyscript-interpreters, state-pyscript-default-interpreter, pyscript-show, pyscript-data
#import "./rss.typ": rss
#import "./icons.typ"
@ -9,8 +10,10 @@
/// Mail template function
#let webpage(
/// Page url
url: none,
/// The base url of the site (eg: "http://test.example.com")
base-url: none,
/// The url path of the page (full url of the page is base-url + path), eg: "/index.html"
path: none,
/// Title of the page, default to document.title
title: none,
/// Use only for html 'lang' attribute.
@ -32,6 +35,8 @@
stylesheets: (),
/// List of related sites for metadata
me-links: (),
/// Label of the page (for links)
page-label: none,
/// Dictionnary of available pyscript-data for each versions of pyscript
/// expected in the form of ("<version>": pyscript-data-list("<url>", { html.link(...) }), ...)
pyscript-data-list: (:),
@ -56,7 +61,9 @@
/// Body of the page
body
) = {
assert(type(url) == str, message: "A page must have an url")
assert(type(base-url) == str, message: "A page must have a base url")
assert(type(path) == str, message: "A page must have a path")
context {
state-pyscript-data-list.update(x => pyscript-data-list)
state-pyscript-interpreters.update(x => pyscript-interpreters)
@ -65,10 +72,13 @@
}
show: html-show
show raw.where(block: true, lang: "python-run"): pyscript-show
current-page-label.update(x => page-label)
html.html(lang: lang, {
html-head(
url,
base-url,
path,
title,
page-label,
icon: icon,
og-type: og-type,
site-name: site-name,
@ -84,7 +94,11 @@
footer: footer,
nav-elements: nav-elements,
menu: menu,
body
[
#body
#metadata("end of page " + str(page-label)) #label(str(page-label) + "-end")
]
)
reset-page-states()
})
}