add support for tags
This commit is contained in:
parent
16d17f7ed7
commit
f653ed944f
6 changed files with 47 additions and 1 deletions
|
|
@ -51,6 +51,30 @@
|
|||
margin-top: auto;
|
||||
padding-top: 1em;
|
||||
}
|
||||
|
||||
tag-box {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
margin-top: 0.3em;
|
||||
|
||||
.tag {
|
||||
max-width: ;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
display:inline-block;
|
||||
white-space: nowrap;
|
||||
|
||||
background-color: var(--color-bg-highlight);
|
||||
margin: 0.1em;
|
||||
padding-top: 0.1em;
|
||||
padding-bottom: 0.1em;
|
||||
padding-left: 0.4em;
|
||||
padding-right: 0.4em;
|
||||
border-radius: 1em;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -68,6 +92,7 @@
|
|||
html.a(href: summ.template-args.url, 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) })
|
||||
})
|
||||
})
|
||||
}
|
||||
|
|
@ -92,6 +117,8 @@
|
|||
description: none,
|
||||
/// The date of publication (or maybe update?) of the page.
|
||||
date: none,
|
||||
/// Tags associated to the content of the page
|
||||
tags: (),
|
||||
) = {
|
||||
assert(type(url) == str, message: "summary() must have an url")
|
||||
assert(type(title) == str or type(title) == content, message: "summary() must have title")
|
||||
|
|
@ -109,6 +136,7 @@
|
|||
),
|
||||
template-args: (
|
||||
url: url,
|
||||
tags: tags,
|
||||
),
|
||||
preview-image: preview-image,
|
||||
img-copyright: img-copyright,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue