From 6cc5bb33a1785a6069e6c9aa6612c8947e017915 Mon Sep 17 00:00:00 2001 From: FarseaSH Date: Sat, 9 Apr 2022 17:49:51 +0800 Subject: [PATCH] FEATURE: picure caption test --- layouts/partials/pic_set.html | 5 ++++- layouts/partials/row.html | 7 ++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/layouts/partials/pic_set.html b/layouts/partials/pic_set.html index b4d66aa..667d6c6 100644 --- a/layouts/partials/pic_set.html +++ b/layouts/partials/pic_set.html @@ -1,17 +1,20 @@ +{{ $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 }} +
{{ range $num, $a := .pic_set }}
diff --git a/layouts/partials/row.html b/layouts/partials/row.html index 752a025..ca8e342 100644 --- a/layouts/partials/row.html +++ b/layouts/partials/row.html @@ -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 }}