blob: d8e63fedaf71a156fff083dd5c77167c98324321 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
{{ $GALLERY_IMAGES_DISPLAYED_LIMIT := 3 }}
{{ if and .Site.Params.imageGallery .Params.gallery }}
{{ $galleryLength := len .Params.gallery }}
{{ $imageGalleryClass := "" }}
{{ if gt $galleryLength 0 }}
<div class="image-gallery">
<div class="image-gallery-metabar">
<span>{{ i18n "post.gallery"}} {{ if gt $galleryLength 1 }}{{ replace (i18n "post.image.other") "{n}" $galleryLength }}{{ else }}{{ i18n "post.image.one" }}{{ end }}</span>
</div>
<div class="image-gallery-photos {{ if gt $galleryLength 2 }}image-gallery-photos--thumbnail{{ end }}">
{{ range $index, $element := .Params.gallery }}
{{ $image := findRE "[^\\s\"']+|\"([^\"]*)\"|'([^']*)'" $element }}
{{ $imageLength := len $image }}
<div class="photo-box">
<a class="photo-box-inner fancybox"
data-fancybox="gallery-{{ $.File.UniqueID }}"
data-caption="{{ if gt $imageLength 2 }}{{ replace (index $image 2) "\"" "" }}{{ else }}{{ replace (index $image 1) "\"" "" }}{{ end }}"
title="{{ if gt $imageLength 2 }}{{ replace (index $image 2) "\"" "" }}{{ else }}{{ replace (index $image 1) "\"" "" }}{{ end }}"
href="{{ index $image 0 }}"
aria-label="{{ i18n "global.zoom_in_on_picture" }}">
{{ if lt $index $GALLERY_IMAGES_DISPLAYED_LIMIT }}
<img class="photo" src="{{ if gt $imageLength 2 }}{{ index $image 1 }}{{ else }}{{ index $image 0 }}{{ end }}">
{{ end }}
</a>
</div>
{{ end }}
</div>
</div>
{{ end }}
{{ end }}
|