diff options
author | Karl <kc0bfv@gmail.com> | 2022-05-23 06:06:28 +0300 |
---|---|---|
committer | Karl <kc0bfv@gmail.com> | 2022-05-23 06:10:35 +0300 |
commit | 444fca378bb178efc751c35dbe73b72f80923423 (patch) | |
tree | 16237ee609bfcda16bf695d50d201921cbad670d | |
parent | 82283d3a05084eeae22dbae8755f48b617761d00 (diff) |
Fix issue #43
-rw-r--r-- | layouts/_default/list.html | 2 | ||||
-rw-r--r-- | layouts/partials/render_img_column_flexrow.html | 7 |
2 files changed, 6 insertions, 3 deletions
diff --git a/layouts/_default/list.html b/layouts/_default/list.html index f5fe0b3..39f3058 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -143,7 +143,7 @@ {{- end }} {{- $full := $.Scratch.Get "full_resized" }} - {{- $new_img := dict "type" "image" "index" $elem_index "image" $elem_val "thumb" $thumb "full" $full "alt" $alt "phototitle" $phototitle "description" $description "weight" $weight "orig" $elem_val "taxonomies" $taxonomies }} + {{- $new_img := dict "type" "image" "image" $elem_val "thumb" $thumb "full" $full "alt" $alt "phototitle" $phototitle "description" $description "weight" $weight "orig" $elem_val "taxonomies" $taxonomies }} {{- $images := $.Scratch.Get "images" }} {{- $images := $images | append $new_img }} diff --git a/layouts/partials/render_img_column_flexrow.html b/layouts/partials/render_img_column_flexrow.html index ece1792..1ea34a1 100644 --- a/layouts/partials/render_img_column_flexrow.html +++ b/layouts/partials/render_img_column_flexrow.html @@ -45,11 +45,14 @@ {{- $st_name := printf "col-%d" $column_ind }} {{- $st_height_name := printf "col-height-%d" $column_ind }} + {{- /* Create a new version of the elem_val with an index reflecting position now, well after sorting is complete, and as we're placing things */}} + {{- $reind_val := merge $elem_val (dict "index" $elem_index) }} + {{- $column := $.Scratch.Get $st_name }} - {{- $column := $column | append $elem_val }} + {{- $column := $column | append $reind_val }} {{- $.Scratch.Set $st_name $column }} - {{- $.Scratch.Set $st_height_name (add ($.Scratch.Get $st_height_name) $elem_val.thumb.Height) }} + {{- $.Scratch.Set $st_height_name (add ($.Scratch.Get $st_height_name) $reind_val.thumb.Height) }} {{- end }} {{- /* Output the images in columns */}} |