Remove inline style and script of bg-img

* See #22
This commit is contained in:
Track3 2019-01-01 17:53:20 +08:00
parent f38b9203b2
commit 1e17ccb801
6 changed files with 61 additions and 33 deletions

View file

@ -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">