Merge branch 'feature/picset_caption' into dev
This commit is contained in:
commit
d47d80db28
2 changed files with 11 additions and 7 deletions
|
@ -4,13 +4,16 @@
|
||||||
{{ $num_per_row = 2}}
|
{{ $num_per_row = 2}}
|
||||||
{{ $max_width = 53}}
|
{{ $max_width = 53}}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
|
{{ $caption := .caption}}
|
||||||
|
|
||||||
<div class="pic-grid" style="width: {{ $max_width }}%">
|
<div class="pic-grid" style="width: {{ $max_width }}%">
|
||||||
<div class="pure-g">
|
<div class="pure-g">
|
||||||
{{ range $num, $a := .pic_set }}
|
{{ range $num, $a := .pic_set }}
|
||||||
<div class="pure-u-1-{{ $num_per_row }}">
|
<div class="pure-u-1-{{ $num_per_row }}">
|
||||||
<div class="add-padding">
|
<div class="add-padding">
|
||||||
<div class="img-container">
|
<div class="img-container">
|
||||||
<a data-src="{{ $a }}" data-fancybox="gallery">
|
<a data-src="{{ $a }}" data-fancybox="gallery" data-caption="{{ $caption }}">
|
||||||
<img src="{{ $a }}" alt="pictures"/>
|
<img src="{{ $a }}" alt="pictures"/>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -61,7 +61,8 @@
|
||||||
|
|
||||||
{{/* add-on info 1: pictures */}}
|
{{/* add-on info 1: pictures */}}
|
||||||
{{/* new pictures API `pictures` (combine single & multiple pictures)*/}}
|
{{/* new pictures API `pictures` (combine single & multiple pictures)*/}}
|
||||||
{{ $pictures_set:= slice}}
|
{{ $pictures_set := slice}}
|
||||||
|
{{ $picture_caption := .Plain}}
|
||||||
{{ with .Params.pictures }}
|
{{ with .Params.pictures }}
|
||||||
{{ range . }}
|
{{ range . }}
|
||||||
{{ with . }}
|
{{ with . }}
|
||||||
|
@ -72,20 +73,20 @@
|
||||||
|
|
||||||
{{ if (eq (len $pictures_set) 1) }}
|
{{ if (eq (len $pictures_set) 1) }}
|
||||||
{{ range $pictures_set }}
|
{{ range $pictures_set }}
|
||||||
<img src="{{ . }}" class="single-pic" alt="Responsive image" data-fancybox="gallery"></img>
|
<img src="{{ . }}" class="single-pic" alt="Responsive image" data-fancybox="gallery" data-caption={{ $picture_caption }}></img>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{ if (gt (len $pictures_set) 1)}}
|
{{ if (gt (len $pictures_set) 1)}}
|
||||||
{{ partial "pic_set.html" (dict "pic_set" $pictures_set) }}
|
{{ partial "pic_set.html" (dict "pic_set" $pictures_set "other" $.Site.BaseURL "caption" $picture_caption) }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{/* Probably DEPRECATED in the future: single picture (old version API `pic`)*/}}
|
{{/* Probably DEPRECATED in the future: single picture (old version API `pic`)*/}}
|
||||||
{{ with .Params.pic }}
|
{{ with .Params.pic }}
|
||||||
<img src="{{ . }}" class="single-pic" alt="Responsive image" data-fancybox="gallery"></img>
|
<img src="{{ . }}" class="single-pic" alt="Responsive image" data-fancybox="gallery" data-caption={{ $picture_caption }}></img>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{/* Probably DEPRECATED: multiple pictures (old version API `pic_set`) */}}
|
{{/* Probably DEPRECATED in the future: multiple pictures (old version API `pic_set`) */}}
|
||||||
{{ $pic_set_filtered := slice}}
|
{{ $pic_set_filtered := slice}}
|
||||||
{{ with .Params.pic_set }}
|
{{ with .Params.pic_set }}
|
||||||
{{ range . }}
|
{{ range . }}
|
||||||
|
@ -96,7 +97,7 @@
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{ with $pic_set_filtered }}
|
{{ with $pic_set_filtered }}
|
||||||
{{ partial "pic_set.html" (dict "pic_set" .) }}
|
{{ partial "pic_set.html" (dict "pic_set" . "caption" $picture_caption) }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue