Browse Source

move background definitions to site config file

main
Gus Esquivel 8 years ago
parent
commit
0e878f04b2
  1. 11
      layouts/index.html
  2. 2
      src/js/slate.js
  3. 2
      static/js/slate.js

11
layouts/index.html

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

2
src/js/slate.js

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

2
static/js/slate.js

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

Loading…
Cancel
Save