move background definitions to site config file

This commit is contained in:
Gus Esquivel 2017-05-16 15:24:11 -05:00
parent 1edc87c441
commit 0e878f04b2
3 changed files with 5 additions and 10 deletions

View File

@ -1,22 +1,17 @@
<html>
<head>
<title>slate</title>
<title>{{ .Title }}</title>
<link rel="stylesheet" href="css/slate.css">
</head>
<body>
<body{{ if .Site.Params.BackgroundStyle }} style='{{ .Site.Params.BackgroundStyle | safeCSS }}'{{ end }}
{{- if .Site.Params.BackgroundImages }} data-backgrounds='{{ range .Site.Params.BackgroundImages }}{{ . }},{{ end }}'{{- end }}>
{{ partial "nav.html" . }}
<div class="container">{{ partial "tile_slate.html" . }}
</div>
{{ if .Site.Data.page.backgrounds -}}
<background data-backgrounds='{{ range .Site.Data.page.backgrounds }}
{{ . }},{{ end }}
'>
{{- end }}
</body>
<link href="https://fonts.googleapis.com/css?family=Exo" rel="stylesheet">
<script src="js/slate.js"></script>

View File

@ -262,7 +262,7 @@ var renderTiles = function() {
renderTiles();
var getBackgroundImages = function() {
var backgrounds = document.getElementsByTagName("background");
var backgrounds = document.getElementsByTagName("body");
var images = [];
if (backgrounds.length > 0) {
var imgString = backgrounds[0].getAttribute("data-backgrounds");

View File

@ -3463,7 +3463,7 @@ var renderTiles = function() {
renderTiles();
var getBackgroundImages = function() {
var backgrounds = document.getElementsByTagName("background");
var backgrounds = document.getElementsByTagName("body");
var images = [];
if (backgrounds.length > 0) {
var imgString = backgrounds[0].getAttribute("data-backgrounds");