diff --git a/layouts/partials/pic_set.html b/layouts/partials/pic_set.html index 8043035..ad8aedd 100644 --- a/layouts/partials/pic_set.html +++ b/layouts/partials/pic_set.html @@ -4,13 +4,16 @@ {{ $num_per_row = 2}} {{ $max_width = 53}} {{ end }} + +{{ $caption := .caption}} +
{{ range $num, $a := .pic_set }}
diff --git a/layouts/partials/row.html b/layouts/partials/row.html index 8c8b274..f49d3e5 100644 --- a/layouts/partials/row.html +++ b/layouts/partials/row.html @@ -61,7 +61,8 @@ {{/* add-on info 1: pictures */}} {{/* new pictures API `pictures` (combine single & multiple pictures)*/}} - {{ $pictures_set:= slice}} + {{ $pictures_set := slice}} + {{ $picture_caption := .Plain}} {{ with .Params.pictures }} {{ range . }} {{ with . }} @@ -72,20 +73,20 @@ {{ if (eq (len $pictures_set) 1) }} {{ range $pictures_set }} - Responsive image + Responsive image {{ end }} {{ end }} {{ 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 }} {{/* Probably DEPRECATED in the future: single picture (old version API `pic`)*/}} {{ with .Params.pic }} - Responsive image + Responsive image {{ 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}} {{ with .Params.pic_set }} {{ range . }} @@ -96,7 +97,7 @@ {{ end }} {{ with $pic_set_filtered }} - {{ partial "pic_set.html" (dict "pic_set" .) }} + {{ partial "pic_set.html" (dict "pic_set" . "caption" $picture_caption) }} {{ end }}