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 {
|
summary-card-preview {
|
||||||
display: block;
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
||||||
img {
|
img {
|
||||||
|
display: block;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
object-fit: contain;
|
object-fit: contain;
|
||||||
|
|
@ -54,9 +56,12 @@
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
chtml.summary-card({
|
chtml.summary-card({
|
||||||
chtml.summary-card-preview(
|
chtml.summary-card-preview({
|
||||||
html.a(href: summ.template-args.url, summ.preview-image)
|
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({
|
chtml.summary-card-description({
|
||||||
heading(level: 2, html.a(href: summ.template-args.url, summ.document-args.title))
|
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
|
/// 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.
|
/// the images directly in the html file in base64.
|
||||||
preview-image: none,
|
preview-image: none,
|
||||||
|
/// The copyright for the image
|
||||||
|
img-copyright: none,
|
||||||
/// The author or authors of the page
|
/// The author or authors of the page
|
||||||
author: none,
|
author: none,
|
||||||
/// A description of the page
|
/// A description of the page
|
||||||
|
|
@ -104,6 +111,7 @@
|
||||||
url: url,
|
url: url,
|
||||||
),
|
),
|
||||||
preview-image: preview-image,
|
preview-image: preview-image,
|
||||||
|
img-copyright: img-copyright,
|
||||||
card: []
|
card: []
|
||||||
)
|
)
|
||||||
summ.card = gen_summary_card(summ)
|
summ.card = gen_summary_card(summ)
|
||||||
|
|
|
||||||
|
|
@ -172,6 +172,7 @@ thead {
|
||||||
url: "http://test.example.com",
|
url: "http://test.example.com",
|
||||||
title: "Card " + str(perm.at(i)),
|
title: "Card " + str(perm.at(i)),
|
||||||
preview-image: summ.preview-image,
|
preview-image: summ.preview-image,
|
||||||
|
img-copyright: if calc.rem(i, 3) == 0 { [Histausse ] } else { none },
|
||||||
author: "Me!",
|
author: "Me!",
|
||||||
description: lorem(10 * calc.rem(i * 123, 10)),
|
description: lorem(10 * calc.rem(i * 123, 10)),
|
||||||
date: datetime(year: 2000, month: 12, day: perm.at(i)),
|
date: datetime(year: 2000, month: 12, day: perm.at(i)),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue