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

github.com/CaiJimmy/hugo-theme-stack.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJimmy Cai <jimmehcai@gmail.com>2020-09-10 19:58:41 +0300
committerJimmy Cai <jimmehcai@gmail.com>2020-09-10 19:58:41 +0300
commit19ff7a46bb2043c10c519adbdad3620678120d54 (patch)
treee03c3c1f5dd5c9f3ff4bf615aaf4c1f68ce67907
parent28c06ef8ae29d615b7c5c2ba6ebe81400b123a96 (diff)
fix(_default/term): switch to new image helper
-rw-r--r--layouts/_default/term.html14
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>