diff options
author | danielkvist <d94.zaragoza@gmail.com> | 2019-04-02 18:34:47 +0300 |
---|---|---|
committer | danielkvist <d94.zaragoza@gmail.com> | 2019-04-02 18:34:47 +0300 |
commit | 7f83dfa50191f2e948bda87571c543bf1957520b (patch) | |
tree | 746cb890c45bc7664972b5415bc5454d5b86a03a | |
parent | e921ae364ba2a456ead8ca744f895092a661b921 (diff) |
fix problem with background images
-rw-r--r-- | layouts/_default/single.html | 2 | ||||
-rw-r--r-- | layouts/partials/sections.html | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 7d2f167..8dd0d80 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -1,11 +1,13 @@ {{ define "main" }} <article class="single"> {{ $bkg := "" }} + {{ if .Params.images }} {{ if gt (len .Params.Images) 0 }} {{ $bkgImage := print (index .Params.images 0) }} {{ $bkgURL := printf "%s%s" $.Site.BaseURL $bkgImage }} {{ $bkg = printf "%s%s%s" "background-image: url('" $bkgURL "');"}} {{ end }} + {{ end }} <!-- Header --> <header class="single__header bkg-image" style="{{ safeCSS $bkg }} {{ if $bkg }}height: 75vh; {{end}}"> diff --git a/layouts/partials/sections.html b/layouts/partials/sections.html index d2baca2..986eee0 100644 --- a/layouts/partials/sections.html +++ b/layouts/partials/sections.html @@ -5,11 +5,13 @@ {{ $bkg := "" }} {{ $bc := "" }} +{{ if .Params.images }} {{ if gt (len .Params.images) 0 }} {{ $bkgImage := print (index .Params.images 0) }} {{ $bkgURL := printf "%s%s" $.Site.BaseURL $bkgImage }} {{ $bkg = printf "%s%s%s" "background-image: url('" $bkgURL "');"}} {{ end }} +{{ end }} {{ if .Params.borderColor }} {{ $bc = printf "%s%s%s" "border-bottom: 5px solid var(--" (.Params.borderColor) ");"}} |