diff options
author | Shohei Ueda <30958501+peaceiris@users.noreply.github.com> | 2020-12-10 21:51:01 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-10 21:51:01 +0300 |
commit | 247df816eb41d541f31644434f39c4166903ee74 (patch) | |
tree | 05656d808586227b7d38c3decc077b796f52b66d /layouts | |
parent | 141e4077b7fc08e6edd21b02b13162e3161cb41c (diff) |
feat: eyecatching image on posts (#242)
Diffstat (limited to 'layouts')
-rw-r--r-- | layouts/_default/list.html | 1 | ||||
-rw-r--r-- | layouts/_default/single.html | 8 | ||||
-rw-r--r-- | layouts/partials/eyecatch.html | 18 |
3 files changed, 15 insertions, 12 deletions
diff --git a/layouts/_default/list.html b/layouts/_default/list.html index b5507fa3..bfc14b68 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -16,6 +16,7 @@ <div class="column is-10-tablet is-offset-1-tablet is-8-desktop is-offset-2-desktop"> <a href="{{ .Permalink }}" class="normal-link"> <div class="card"> + {{ partial "eyecatch" . }} <div class="card-content"> {{ $title := "" }} {{ with .Title }} diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 755fd913..f8deccc0 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -1,6 +1,12 @@ {{ define "main" }} - {{ partial "eyecatch" . }} + <div class="columns"> + <div class="column is-8 is-offset-2"> + {{ partial "eyecatch" . }} + </div> + </div> + {{ partial "content" . }} + <section class="section"> {{ template "_internal/disqus.html" . }} </section> diff --git a/layouts/partials/eyecatch.html b/layouts/partials/eyecatch.html index 56b493ef..aaa6376c 100644 --- a/layouts/partials/eyecatch.html +++ b/layouts/partials/eyecatch.html @@ -1,15 +1,11 @@ {{ if .Params.eyecatch }} {{ $image := resources.Get .Params.eyecatch }} {{ $imageHash := $image | resources.Fingerprint "sha512" }} - <div class="columns"> - <div class="column is-8 is-offset-2"> - <img - class="" - src="{{- $imageHash.Permalink -}}" - alt="{{ $.Params.Description }}" - decoding="async" - loading="lazy" - /> - </div> - </div> + <img + class="" + src="{{- $imageHash.Permalink -}}" + alt="{{ $.Params.Description }}" + decoding="async" + loading="lazy" + /> {{ end }} |