aboutsummaryrefslogtreecommitdiff
path: root/layouts
diff options
context:
space:
mode:
authorTrack3 <pengliabc@live.cn>2019-01-03 18:25:14 +0800
committerTrack3 <pengliabc@live.cn>2019-01-03 18:25:14 +0800
commit334d05e5a17701f171f0221c95c9235e52fa8f46 (patch)
treef919eb9605316ad3f92b20c15c683c3e079f7b9b /layouts
parentf601584822fb6cc5877b2a28848e6103a775b35f (diff)
Fix featured image toggle
Diffstat (limited to 'layouts')
-rw-r--r--layouts/_default/single.html10
-rw-r--r--layouts/index.html10
-rw-r--r--layouts/posts/single.html10
3 files changed, 9 insertions, 21 deletions
diff --git a/layouts/_default/single.html b/layouts/_default/single.html
index a00bc3b..900b3f7 100644
--- a/layouts/_default/single.html
+++ b/layouts/_default/single.html
@@ -1,15 +1,11 @@
{{ define "head" }}
- <style>
- .bg-img {background-image: url('
- {{- if .Params.featuredImg -}}
- {{.Params.featuredImg | absURL}}
+ {{ if .Params.featuredImg -}}
+ <style>.bg-img {background-image: url('{{.Params.featuredImg | absURL}}');}</style>
{{- else if .Params.images -}}
{{- range first 1 .Params.images -}}
- {{. | absURL}}
+ <style>.bg-img {background-image: url('{{. | absURL}}');}</style>
{{- end -}}
{{- end -}}
- ');}
- </style>
{{ end }}
{{ define "header" }}
diff --git a/layouts/index.html b/layouts/index.html
index 7927023..23bb608 100644
--- a/layouts/index.html
+++ b/layouts/index.html
@@ -1,15 +1,11 @@
{{ define "head" }}
- <style>
- .bg-img {background-image: url('
- {{- if .Site.Params.bgImg -}}
- {{.Site.Params.bgImg | absURL}}
+ {{ if .Site.Params.bgImg -}}
+ <style>.bg-img {background-image: url('{{.Site.Params.bgImg | absURL}}');}</style>
{{- else if .Site.Params.images -}}
{{- range first 1 .Site.Params.images -}}
- {{. | absURL}}
+ <style>.bg-img {background-image: url('{{. | absURL}}');}</style>
{{- end -}}
{{- end -}}
- ');}
- </style>
{{ end }}
{{ define "main" }}
diff --git a/layouts/posts/single.html b/layouts/posts/single.html
index dc70fd3..02e3fd5 100644
--- a/layouts/posts/single.html
+++ b/layouts/posts/single.html
@@ -1,15 +1,11 @@
{{ define "head" }}
- <style>
- .bg-img {background-image: url('
- {{- if .Params.featuredImg -}}
- {{.Params.featuredImg | absURL}}
+ {{ if .Params.featuredImg -}}
+ <style>.bg-img {background-image: url('{{.Params.featuredImg | absURL}}');}</style>
{{- else if .Params.images -}}
{{- range first 1 .Params.images -}}
- {{. | absURL}}
+ <style>.bg-img {background-image: url('{{. | absURL}}');}</style>
{{- end -}}
{{- end -}}
- ');}
- </style>
{{ end }}
{{ define "header" }}