Add initial thumbnail support
This commit is contained in:
parent
0fdc2d5677
commit
b267de84f8
3 changed files with 8 additions and 0 deletions
|
@ -2,6 +2,7 @@
|
|||
<div class="main">
|
||||
<div class="single block">
|
||||
<article class="post">
|
||||
{{- partial "post_thumbnail.html" (dict "page" . ) }}
|
||||
<div class="post__meta meta mb">{{ partial "post_meta.html" . }}</div>
|
||||
<h1 class="post__title">{{ .Title }}</h1>
|
||||
<div class="post__content">{{ .Content }}</div>
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
<article class="post card__box block">
|
||||
{{- partial "post_thumbnail.html" (dict "page" . ) }}
|
||||
<h1 class="post__title"><a class="post__title-link" href="{{ .RelPermalink }}">{{ .Title }}</a></h1>
|
||||
<div class="post__content">{{- .Summary }}</div>
|
||||
<div class="post__meta meta mt tar">{{ partial "post_meta.html" . }}</div>
|
||||
|
|
6
layouts/partials/post_thumbnail.html
Normal file
6
layouts/partials/post_thumbnail.html
Normal file
|
@ -0,0 +1,6 @@
|
|||
{{- $img := ( .page.Resources.ByType "image").GetMatch "thumbnail.*" }}
|
||||
{{- with $img }}
|
||||
<figure class="post__thumbnail thumbnail">
|
||||
<img class="thumbnail__img" src="{{ $img.RelPermalink }}" alt="{{ $img.Title }}">
|
||||
</figure>
|
||||
{{- end }}
|
Loading…
Reference in a new issue