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> <html>
<head> <head>
<title>slate</title> <title>{{ .Title }}</title>
<link rel="stylesheet" href="css/slate.css"> <link rel="stylesheet" href="css/slate.css">
</head> </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" . }} {{ partial "nav.html" . }}
<div class="container">{{ partial "tile_slate.html" . }} <div class="container">{{ partial "tile_slate.html" . }}
</div> </div>
{{ if .Site.Data.page.backgrounds -}}
<background data-backgrounds='{{ range .Site.Data.page.backgrounds }}
{{ . }},{{ end }}
'>
{{- end }}
</body> </body>
<link href="https://fonts.googleapis.com/css?family=Exo" rel="stylesheet"> <link href="https://fonts.googleapis.com/css?family=Exo" rel="stylesheet">
<script src="js/slate.js"></script> <script src="js/slate.js"></script>

View File

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

View File

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