diff options
author | Alex Shpak <alex-shpak@users.noreply.github.com> | 2021-05-03 21:47:19 +0200 |
---|---|---|
committer | Alex Shpak <alex-shpak@users.noreply.github.com> | 2021-05-03 21:47:19 +0200 |
commit | c197f3399b0aee698afc5278dbb33506892311ef (patch) | |
tree | 0ab46c0cfdfdaf28e77e038cc41c80c144c1d3e7 /layouts | |
parent | e0823c213882489bb4ee3959bf2b306061762bf1 (diff) |
#286, Add ability to set image for posts
Diffstat (limited to 'layouts')
-rw-r--r-- | layouts/partials/docs/post-meta.html | 10 | ||||
-rw-r--r-- | layouts/posts/single.html | 4 |
2 files changed, 11 insertions, 3 deletions
diff --git a/layouts/partials/docs/post-meta.html b/layouts/partials/docs/post-meta.html index c56a528..527431a 100644 --- a/layouts/partials/docs/post-meta.html +++ b/layouts/partials/docs/post-meta.html @@ -11,3 +11,13 @@ </div> {{ end }} {{ end }} + +<p> +{{ if .Params.image}} + {{ with .Resources.GetMatch .Params.image }} + <img src={{ .RelPermalink }} /> + {{ else }} + <img src={{ .Params.image | relURL }} /> + {{ end }} +{{ end }} +</p> diff --git a/layouts/posts/single.html b/layouts/posts/single.html index 00df697..79cd303 100644 --- a/layouts/posts/single.html +++ b/layouts/posts/single.html @@ -4,9 +4,7 @@ <a href="{{ .RelPermalink }}">{{ .Title }}</a> </h1> {{ partial "docs/post-meta" . }} - <p> - {{- .Content -}} - </p> + {{- .Content -}} </article> {{ end }} |