FEATURE: picure caption test

This commit is contained in:
FarseaSH 2022-04-09 17:49:51 +08:00
parent b7f992bebb
commit 6cc5bb33a1
2 changed files with 10 additions and 2 deletions
layouts/partials

View file

@ -1,17 +1,20 @@
<!-- START -->
{{ $caption := .other }}
{{ $num_per_row := 3}}
{{ $max_width := 80}}
{{ if or (eq (len .pic_set) 2) (eq (len .pic_set) 4)}}
{{ $num_per_row = 2}}
{{ $max_width = 53}}
{{ end }}
<div class="pic-grid" style="width: {{ $max_width }}%">
<div class="pure-g">
{{ range $num, $a := .pic_set }}
<div class="pure-u-1-{{ $num_per_row }}">
<div class="add-padding">
<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"/>
</a>
</div>

View file

@ -93,8 +93,13 @@
{{ end }}
{{ end }}
{{ $test := "test" }}
{{ 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) */}}
{{ partial "pic_set.html" (dict "pic_set" $pictures_set "other" $.Site.BaseURL) }}
{{ $test }}
{{ partial "pic_set.html" (dict "pic_set" $pictures_set "other" $.Site.BaseURL) }}
{{/* partial "pic_set.html" $pictures_set "other" */}}
{{ end }}
<!-- add-on info 2: link -->