mirror of
https://github.com/CaiJimmy/hugo-theme-stack.git
synced 2024-11-27 04:03:48 +01:00
fix: use page resource permalink in link image (#990)
closes https://github.com/CaiJimmy/hugo-theme-stack/issues/982
This commit is contained in:
parent
54a8ace564
commit
23607527e4
1 changed files with 5 additions and 1 deletions
|
@ -16,8 +16,12 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{ with $link.image }}
|
{{ with $link.image }}
|
||||||
|
{{ $permalink := . }}
|
||||||
|
{{ with ($.Resources.GetMatch (printf "%s" (. | safeURL))) }}
|
||||||
|
{{ $permalink = .RelPermalink }}
|
||||||
|
{{ end }}
|
||||||
<div class="article-image">
|
<div class="article-image">
|
||||||
<img src="{{ . }}" loading="lazy">
|
<img src="{{ $permalink }}" loading="lazy">
|
||||||
</div>
|
</div>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</a>
|
</a>
|
||||||
|
|
Loading…
Reference in a new issue