Skip to content

Commit f1a9346

Browse files
committed
chore: add link on images on blog post preview
1 parent cc52cdb commit f1a9346

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

site/layouts/blog/li.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,13 @@
55
{{ with .Resources.GetMatch .Params.cover }}
66
{{ with .Fill "336x200 Center webp q100" }}
77
<div class="img-container">
8+
{{ if $.Truncated }}
9+
<a href="{{ $.Permalink }}" aria-hidden="true" tabindex="-1">
10+
<img src="{{ .RelPermalink }}" width="{{ .Width }}" height="{{ .Height }}" alt="" loading="lazy">
11+
</a>
12+
{{ else }}
813
<img src="{{ .RelPermalink }}" width="{{ .Width }}" height="{{ .Height }}" alt="" loading="lazy">
14+
{{ end }}
915
</div>
1016
{{ end }}
1117
{{ end }}

0 commit comments

Comments
 (0)