diff options
-rw-r--r-- | layouts/_default/term.html | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/layouts/_default/term.html b/layouts/_default/term.html index cae47d1..d0f9471 100644 --- a/layouts/_default/term.html +++ b/layouts/_default/term.html @@ -15,12 +15,16 @@ {{ end }} </div> - {{ if .Params.image }} - {{- $image := partial "helper/image" . -}} - {{- $thumbnail := $image.Fill "120x120" -}} + {{ $image := partial "helper/image" . }} + {{ if $image.exists }} <div class="taxonomy-image"> - <img src="{{ $thumbnail.RelPermalink }}" width="{{ $thumbnail.Width }}" - height="{{ $thumbnail.Height }}" loading="lazy"> + {{ if $image.local }} + {{- $thumbnail := $image.src.Fill "120x120" -}} + <img src="{{ $thumbnail.RelPermalink }}" width="{{ $thumbnail.Width }}" + height="{{ $thumbnail.Height }}" loading="lazy"> + {{ else }} + <img src="{{ $image.src }}" loading="lazy"> + {{ end }} </div> {{ end }} </div> |