add option to indicate image copyright for summary preview
This commit is contained in:
parent
e0e86201e6
commit
16d17f7ed7
2 changed files with 12 additions and 3 deletions
|
|
@ -23,10 +23,12 @@
|
|||
}
|
||||
|
||||
summary-card-preview {
|
||||
display: block;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
width: 100%;
|
||||
|
||||
img {
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: contain;
|
||||
|
|
@ -54,9 +56,12 @@
|
|||
}
|
||||
```
|
||||
chtml.summary-card({
|
||||
chtml.summary-card-preview(
|
||||
chtml.summary-card-preview({
|
||||
html.a(href: summ.template-args.url, 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))
|
||||
|
||||
|
|
@ -79,6 +84,8 @@
|
|||
/// Right now, this cannot be used for link preview because open graph expect an url for the image, and typst inline
|
||||
/// the images directly in the html file in base64.
|
||||
preview-image: none,
|
||||
/// The copyright for the image
|
||||
img-copyright: none,
|
||||
/// The author or authors of the page
|
||||
author: none,
|
||||
/// A description of the page
|
||||
|
|
@ -104,6 +111,7 @@
|
|||
url: url,
|
||||
),
|
||||
preview-image: preview-image,
|
||||
img-copyright: img-copyright,
|
||||
card: []
|
||||
)
|
||||
summ.card = gen_summary_card(summ)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue