diff options
Diffstat (limited to 'layouts/shortcodes/img.html')
-rw-r--r-- | layouts/shortcodes/img.html | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/layouts/shortcodes/img.html b/layouts/shortcodes/img.html index 436feb6..ffbc6c0 100644 --- a/layouts/shortcodes/img.html +++ b/layouts/shortcodes/img.html @@ -6,13 +6,14 @@ {{- with $source }} {{- $caption := default .Title $customAlt }} + {{- $origin := .Permalink }} {{- $profile := (.Fill "180x180 Center").Permalink }} {{- $tiny := (.Resize "320x").Permalink }} {{- $small := (.Resize "600x").Permalink }} {{- $medium := (.Resize "1200x").Permalink }} {{- $large := (.Resize "1800x").Permalink }} - {{- $size := dict "profile" $profile "tiny" $tiny "small" $small "medium" $medium "large" $large }} + {{- $size := dict "origin" $origin "profile" $profile "tiny" $tiny "small" $small "medium" $medium "large" $large }} <div class="flex justify-center"> @@ -31,7 +32,11 @@ /> <img {{- if $lazyLoad }}{{ print " loading=\"lazy\"" | safeHTMLAttr }}{{- end }} - src="{{ $size.large }}" + {{- if eq $customSize "origin" }} + src="{{ $size.origin }}" + {{- else }} + src="{{ $size.large }}" + {{- end }} alt="{{ $caption }}" /> </picture> |