Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/kc0bfv/autophugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSylvia <sylvie@gmail.com>2021-09-16 13:45:39 +0300
committerKarl <kc0bfv@gmail.com>2021-11-12 01:30:51 +0300
commite7e8e13b10c4634523b98a9912ed36bf22fcaee5 (patch)
treee0bf627b73bbe03e8f072b047d84040cfe64f4a6
parent74b26dccda624f6678c6c941f7285184239cbce6 (diff)
Allow to overwrite resize logic to support restriction by height (makes more sense for row based layouts).
-rw-r--r--layouts/partials/sect_and_img_content.html15
1 files changed, 13 insertions, 2 deletions
diff --git a/layouts/partials/sect_and_img_content.html b/layouts/partials/sect_and_img_content.html
index a7b995a..1449d88 100644
--- a/layouts/partials/sect_and_img_content.html
+++ b/layouts/partials/sect_and_img_content.html
@@ -10,8 +10,19 @@
{{- $filename_as_phototitle := default false ($.Param "filename_as_phototitle") }}
{{- $downloadable := default true ($.Param "images_downloadable") }}
- {{- $thumb_size := printf "%dx q%d" $thumb_width $thumb_quality }}
- {{- $full_size := printf "%dx q%d" $full_width $full_quality }}
+ {{- /* Calculate thumb_size string from params unless a finished string is provided in the config. */}}
+ {{- $.Scratch.Set "thumb_size" (default "" ($.Param "thumb_size")) }}
+ {{ if (eq ($.Scratch.Get "thumb_size") "") }}
+ {{- $.Scratch.Set "thumb_size" (printf "%dx q%d" $thumb_width $thumb_quality) }}
+ {{ end }}
+ {{- $thumb_size := $.Scratch.Get "thumb_size" }}
+
+ {{- /* Same for full_size string */}}
+ {{- $.Scratch.Set "full_size" (default "" ($.Param "full_size")) }}
+ {{ if (eq ($.Scratch.Get "full_size") "") }}
+ {{- $.Scratch.Set "full_size" (printf "%dx q%d" $full_width $full_quality) }}
+ {{ end }}
+ {{- $full_size := $.Scratch.Get "full_size" }}
{{- /* Build the list of sections and thumbnails */}}
{{- $.Scratch.Set "sections" (slice) }}