[feature] Photoswipe gallery (#740)

* implement photoswipe galleries

* dependency wrangling

* photoswipe-dynamic-caption plugin
This commit is contained in:
f0x52
2022-08-07 17:58:01 +02:00
committed by GitHub
parent 745f54970d
commit f2a6ae3ef8
6 changed files with 51 additions and 10 deletions

View File

@@ -15,9 +15,9 @@
</div>
</div>
{{with .MediaAttachments}}
<div class="media {{(len .) | oddOrEven }}{{if eq (len .) 1}} single{{end}}{{if eq (len .) 2}} double{{end}}">
<div class="media photoswipe-gallery {{(len .) | oddOrEven }}{{if eq (len .) 1}} single{{end}}{{if eq (len .) 2}} double{{end}}">
{{range .}}
<a href="{{.URL}}" target="_blank" title="{{.Description}}">
<a href="{{.URL}}" target="_blank" title="{{.Description}}" data-pswp-width="{{.Meta.Original.Width}}px" data-pswp-height="{{.Meta.Original.Height}}px">
{{if not .Description}}
<div class="no-image-desc" aria-hidden="true" ><i class="fa fa-info-circle"></i><span>Missing image description</span></div>
{{end}}