diff options
| author | Track3 <pengliabc@live.cn> | 2019-01-01 17:53:20 +0800 |
|---|---|---|
| committer | Track3 <pengliabc@live.cn> | 2019-01-01 17:53:20 +0800 |
| commit | 1e17ccb8012d9ff48ceba737e49ec5e5444247d6 (patch) | |
| tree | 1bf9d019c3902fc3e04d4005ae816c48c0b834e9 /layouts/index.html | |
| parent | f38b9203b28aa8b2799d8de7a5c57a1a4aa4be0c (diff) | |
| download | hermit-1e17ccb8012d9ff48ceba737e49ec5e5444247d6.tar.gz | |
Remove inline style and script of bg-img
* See #22
Diffstat (limited to 'layouts/index.html')
| -rw-r--r-- | layouts/index.html | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/layouts/index.html b/layouts/index.html index 0535cbb..7927023 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -1,10 +1,20 @@ +{{ define "head" }} + <style> + .bg-img {background-image: url(' + {{- if .Site.Params.bgImg -}} + {{.Site.Params.bgImg | absURL}} + {{- else if .Site.Params.images -}} + {{- range first 1 .Site.Params.images -}} + {{. | absURL}} + {{- end -}} + {{- end -}} + ');} + </style> +{{ end }} + {{ define "main" }} - {{- if .Site.Params.bgImg }} - <div class="bg-img" style="background-image: url({{.Site.Params.bgImg}});"></div> - {{- else if .Site.Params.images }} - {{- range first 1 .Site.Params.images }} - <div class="bg-img" style="background-image: url({{.}});"></div> - {{- end }} + {{- if (or .Site.Params.images .Site.Params.bgImg) }} + <div class="bg-img"></div> {{- end }} <div id="spotlight" class="animated fadeIn"> <div id="home-center"> |
