Add initial thumbnail support

This commit is contained in:
vimux 2018-05-21 23:08:56 +03:00
parent 0fdc2d5677
commit b267de84f8
No known key found for this signature in database
GPG key ID: 5A34FDC4EE832E34
3 changed files with 8 additions and 0 deletions

View file

@ -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>

View file

@ -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>

View 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 }}