Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gesquive/slate.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGus Esquivel <gesquive@gmail.com>2017-05-16 23:24:11 +0300
committerGus Esquivel <gesquive@gmail.com>2017-05-16 23:24:11 +0300
commit0e878f04b2d61be155eea77d7fe183f5dbf4b497 (patch)
tree5c0393927fcfad3eda817c8238019f572ee812e2
parent1edc87c4417b220f4e61f93527d910e39a8f97cf (diff)
move background definitions to site config file
-rw-r--r--layouts/index.html11
-rw-r--r--src/js/slate.js2
-rw-r--r--static/js/slate.js2
3 files changed, 5 insertions, 10 deletions
diff --git a/layouts/index.html b/layouts/index.html
index f0765ce..f3963fb 100644
--- a/layouts/index.html
+++ b/layouts/index.html
@@ -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>
diff --git a/src/js/slate.js b/src/js/slate.js
index c14eab0..a9f8d60 100644
--- a/src/js/slate.js
+++ b/src/js/slate.js
@@ -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");
diff --git a/static/js/slate.js b/static/js/slate.js
index 20075b7..b546c22 100644
--- a/static/js/slate.js
+++ b/static/js/slate.js
@@ -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");