Skip to content

Commit

Permalink
Allow to use the original image as thumbnail if thumbnailResizeOption…
Browse files Browse the repository at this point in the history
…s is set to an empty string
  • Loading branch information
mfg92 committed Jun 28, 2024
1 parent a330442 commit 068e76d
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions layouts/shortcodes/gallery.html
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,14 @@
if the EXIF informations contains an orientation value. See issue #22. */}}
{{ $rotated := $original.Filter images.AutoOrient }}

{{/* Create thumbnail, rotate it if needed */}}
{{ $thumbnail := ($rotated.Fit $thumbnailResizeOptions) }}

{{ $thumbnail := "" }}
{{ if not (eq $thumbnailResizeOptions "") }}
{{/* Create thumbnail, rotate it if needed */}}
{{ $thumbnail = ($rotated.Fit $thumbnailResizeOptions) }}
{{ else }}
{{/* If thumbnailResizeOptions is left empty, use the original image for the thumbnail */}}
{{ $thumbnail = $original }}
{{ end }}

<div>
{{ $full := "" }}
Expand Down

0 comments on commit 068e76d

Please sign in to comment.