Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Track3/hermit.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'layouts/posts/single.html')
-rw-r--r--layouts/posts/single.html22
1 files changed, 16 insertions, 6 deletions
diff --git a/layouts/posts/single.html b/layouts/posts/single.html
index 026a626..dc70fd3 100644
--- a/layouts/posts/single.html
+++ b/layouts/posts/single.html
@@ -1,14 +1,24 @@
+{{ define "head" }}
+ <style>
+ .bg-img {background-image: url('
+ {{- if .Params.featuredImg -}}
+ {{.Params.featuredImg | absURL}}
+ {{- else if .Params.images -}}
+ {{- range first 1 .Params.images -}}
+ {{. | absURL}}
+ {{- end -}}
+ {{- end -}}
+ ');}
+ </style>
+{{ end }}
+
{{ define "header" }}
{{ partial "header.html" . }}
{{ end }}
{{ define "main" }}
- {{- 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 }}
+ {{- if (or .Params.images .Params.featuredImg) }}
+ <div class="bg-img"></div>
{{- end }}
<main class="site-main section-inner animated fadeIn faster">
<article class="thin">