diff options
| author | Track3 <pengliabc@live.cn> | 2018-12-31 20:03:32 +0800 |
|---|---|---|
| committer | Track3 <pengliabc@live.cn> | 2018-12-31 20:08:04 +0800 |
| commit | 4b2192f2fa89f10d09fabc48105465865ef01943 (patch) | |
| tree | faf5519751b4994ccbeb1b8558295528317c2f87 /layouts/posts/single.html | |
| parent | f5b68c452f6df102ee2e40e638cb8988798099ef (diff) | |
| download | hermit-4b2192f2fa89f10d09fabc48105465865ef01943.tar.gz | |
Use `images` instead of `featuredImg`
`featuredImg` and `bgImg` are preserved in case you want to use a different background image from metadata images
Diffstat (limited to 'layouts/posts/single.html')
| -rw-r--r-- | layouts/posts/single.html | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/layouts/posts/single.html b/layouts/posts/single.html index 224995e..026a626 100644 --- a/layouts/posts/single.html +++ b/layouts/posts/single.html @@ -3,9 +3,13 @@ {{ end }} {{ define "main" }} - {{- with .Params.featuredImg }} + {{- if .Params.featuredImg }} + <div id="bg-img" class="bg-img" style="background-image: url({{.Params.featuredImg}});" onclick="showContent()"></div> + {{- else if .Params.images }} + {{- range first 1 .Params.images }} <div id="bg-img" class="bg-img" style="background-image: url({{.}});" onclick="showContent()"></div> {{- end }} + {{- end }} <main class="site-main section-inner animated fadeIn faster"> <article class="thin"> <header class="post-header"> @@ -51,7 +55,7 @@ {{- end }} </div> <div id="comments" class="thin"> - {{ partial "comments.html" . }} + {{- partial "comments.html" . -}} </div> </main> {{ end }} |
