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
|
@ -2,7 +2,7 @@
|
||||||
<main class="main">
|
<main class="main">
|
||||||
<div class="single block">
|
<div class="single block">
|
||||||
<article class="post">
|
<article class="post">
|
||||||
{{- partial "post_thumbnail.html" (dict "page" . ) }}
|
{{- partial "post_thumbnail.html" (dict "page" .) }}
|
||||||
{{- partial "post_meta.html" (dict "dot" . "class" "mb") }}
|
{{- partial "post_meta.html" (dict "dot" . "class" "mb") }}
|
||||||
<h1 class="post__title">{{ .Title }}</h1>
|
<h1 class="post__title">{{ .Title }}</h1>
|
||||||
{{- partial "post_toc.html" . }}
|
{{- partial "post_toc.html" . }}
|
||||||
|
|
|
@ -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">
|
||||||
<img class="thumbnail__img" src="{{ $img.RelPermalink }}" alt="{{ $img.Title }}">
|
{{- with $link }}
|
||||||
|
<a class="thumbnail__link" href="{{ . }}">
|
||||||
|
<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