pict-rs-proxy/templates/thumbnails.rs.html

46 lines
1.7 KiB
HTML
Raw Normal View History

2020-06-18 00:46:57 +00:00
@use super::{layout_html, return_home_html, statics::images_css};
2020-12-03 18:48:52 +00:00
@use crate::{Image, FileType};
2020-06-18 00:46:57 +00:00
@(image: Image, sizes: &[u64])
2020-12-03 19:40:16 +00:00
@:layout_html("Thumbnails", Some(&format!("Thumbnails for {}", image.filename())), {
<meta property="og:image" content="@image.link()" />
<meta property="og:url" content="@image.link()" />
<meta property="og:image:alt" content="Image: @image.filename()" />
2021-09-12 16:27:22 +00:00
<link rel="stylesheet" href="@crate::statics(images_css.name)" type="text/css" />
2020-06-18 00:46:57 +00:00
}, {
<section>
<article>
<h3>Here are your thumbnails</h3>
</article>
<ul>
<li>
<article>
2020-12-03 19:40:16 +00:00
<p>Original File:<br /><a href="@image.view(None)">@image.view(None)</a></p>
2020-06-18 00:46:57 +00:00
</article>
</li>
@for size in sizes {
<li>
<article>
2020-12-03 18:48:52 +00:00
<picture>
<source type="image/webp" srcset="@image.thumb(*size, FileType::Webp)" />
<img src="@image.thumb(*size, FileType::Jpg)" alt="@image.filename()" title="@image.filename()" />
</picture>
2020-06-18 00:46:57 +00:00
<p>@size x @size</p>
<p>
<a
2020-12-03 19:40:16 +00:00
href="@image.view(Some(*size))"
2020-06-18 00:46:57 +00:00
target="_blank"
rel="noopener noreferrer"
>
2020-12-03 19:40:16 +00:00
@image.view(Some(*size))
2020-06-18 00:46:57 +00:00
</a>
</p>
</article>
</li>
}
</ul>
@:return_home_html()
</section>
})