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

@ -81,15 +81,15 @@
```
chtml.summary-card({
chtml.summary-card-preview({
html.a(href: summ.template-args.url, summ.preview-image)
link(summ.template-args.page-label, summ.preview-image)
if summ.img-copyright != none {
html.small[Image: #sym.copyright #summ.img-copyright]
}
})
chtml.summary-card-description({
heading(level: 2, html.a(href: summ.template-args.url, summ.document-args.title))
heading(level: 2, link(summ.template-args.page-label, summ.document-args.title))
html.a(href: summ.template-args.url, summ.document-args.description)
link(summ.template-args.page-label, summ.document-args.description)
chtml.summary-card-details(summ.document-args.date.display())
chtml.tag-box(for tag in summ.template-args.tags { html.span(class: ("tag",), "#" + tag) })
@ -101,8 +101,10 @@
/// Store data form `set document(...)` and `show: webpage.with(...)` in `summ.document-args` and `summ.template-args`,
/// and generate a summary card that can be used as a link for the page.
#let summary(
/// The url of the page
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,
/// The title of the page
title: none,
/// The image preview of the page.
@ -119,14 +121,21 @@
date: none,
/// Tags associated to the content of the page
tags: (),
/// Label of the page (for links)
page-label: none,
) = {
assert(type(url) == str, message: "summary() must have an url")
assert(type(base-url) == str, message: "summary() must have a base url")
assert(type(path) == str, message: "summary() must have a path")
assert(type(title) == str or type(title) == content, message: "summary() must have title")
assert(type(preview-image) != none, message: "summary() must have a preview-image")
assert(type(author) != none, message: "summary() must have at least one author")
assert(type(description) != none, message: "summary() must have a description")
assert(type(date) != none, message: "summary() must have a date")
if page-label == none {
page-label = label(path)
}
let summ = (
document-args: (
title: title,
@ -135,9 +144,12 @@
date: date,
),
template-args: (
url: url,
base-url: base-url,
path: path,
tags: tags,
page-label: page-label,
),
path: path,
preview-image: preview-image,
img-copyright: img-copyright,
card: []