summaryrefslogtreecommitdiff
path: root/layouts/term.html
diff options
context:
space:
mode:
authorEltrac <hi@guhub.cn>2025-08-18 21:58:22 +0800
committerEltrac <hi@guhub.cn>2025-08-18 21:58:22 +0800
commit8d937546224d544de51f895843b2563beecb349e (patch)
treedd0ae69bebcac659e995aaeff57acff90c258b10 /layouts/term.html
parent971b4904acd4c1c6e155cc954b6a3c21a36af785 (diff)
fix: image icon does not display as expected
Former-commit-id: 25859328ff650f34fb9b5c64916f66e8c3fc707e
Diffstat (limited to 'layouts/term.html')
-rw-r--r--layouts/term.html9
1 files changed, 7 insertions, 2 deletions
diff --git a/layouts/term.html b/layouts/term.html
index fc0d9b43..ffdbdf95 100644
--- a/layouts/term.html
+++ b/layouts/term.html
@@ -5,8 +5,13 @@
<div class="term-header">
<h1 class="term-title"
style="view-transition-name: category-{{ .Title }}">
- {{ with .Params.icon }}
- <span class="category-icon">{{ . }}</span>
+ {{ if or (hasPrefix .Page.Params.icon "http://") (hasPrefix .Page.Params.icon "https://") }}
+ <span>
+ <img src="{{ .Page.Params.icon }}" alt="{{ .Page.LinkTitle }}"
+ style="height:1em;width:1em">
+ </span>
+ {{ else }}
+ <span>{{ .Page.Params.icon }}</span>
{{ end }}
{{ if and (eq .Data.Singular "tag") (not .Params.icon) }}#{{ end }}{{ .Title }}
</h1>