Make thumbnail image clickable on list partial
This commit is contained in:
parent
6b3d4c831c
commit
290d1cb0ae
3 changed files with 11 additions and 4 deletions
|
@ -1,5 +1,5 @@
|
||||||
<article class="post card__box block">
|
<article class="post card__box block">
|
||||||
{{- partial "post_thumbnail.html" (dict "page" . ) }}
|
{{- partial "post_thumbnail.html" (dict "page" . "link" .RelPermalink) }}
|
||||||
<h1 class="post__title title-excerpt"><a class="post__title-link" href="{{ .RelPermalink }}">{{ .Title }}</a></h1>
|
<h1 class="post__title title-excerpt"><a class="post__title-link" href="{{ .RelPermalink }}">{{ .Title }}</a></h1>
|
||||||
<div class="post__content">{{- .Summary }}</div>
|
<div class="post__content">{{- .Summary }}</div>
|
||||||
{{- partial "post_meta.html" (dict "dot" . "class" "mt tar") }}
|
{{- partial "post_meta.html" (dict "dot" . "class" "mt tar") }}
|
||||||
|
|
|
@ -1,6 +1,13 @@
|
||||||
{{- $img := (.page.Resources.ByType "image").GetMatch "thumbnail.*" }}
|
{{- $img := (.page.Resources.ByType "image").GetMatch "thumbnail.*" }}
|
||||||
|
{{- $link := .link }}
|
||||||
{{- with $img }}
|
{{- with $img }}
|
||||||
<figure class="post__thumbnail thumbnail">
|
<figure class="post__thumbnail thumbnail">
|
||||||
|
{{- with $link }}
|
||||||
|
<a class="thumbnail__link" href="{{ . }}">
|
||||||
<img class="thumbnail__img" src="{{ $img.RelPermalink }}" alt="{{ $img.Title }}">
|
<img class="thumbnail__img" src="{{ $img.RelPermalink }}" alt="{{ $img.Title }}">
|
||||||
|
</a>
|
||||||
|
{{- else }}
|
||||||
|
<img class="thumbnail__img" src="{{ $img.RelPermalink }}" alt="{{ $img.Title }}">
|
||||||
|
{{- end }}
|
||||||
</figure>
|
</figure>
|
||||||
{{- end }}
|
{{- end }}
|
Loading…
Reference in a new issue