Replace implode plugin by join filter

This commit is contained in:
2016-01-26 09:07:15 +00:00
parent 283317b3b9
commit 3a0d77208f
2 changed files with 1 additions and 13 deletions

View File

@@ -35,7 +35,7 @@
_gaq.push(['_setAccount', '{{ site.analytics }}']);
_gaq.push(['_trackPageview']);
window.onload = function() {
var headers = {{ site.headers | implode }};
var headers = ['{{ site.headers | join:"', '" }}'];
var header = headers[Math.floor(Math.random() * headers.length)];
document.getElementById('masthead').style.backgroundImage = "url('/asset/header/" + header + ".jpg')";

View File

@@ -1,12 +0,0 @@
# adapted from
# - https://github.com/kenhkelly/kenhkelly.us/blob/master/_plugins/implode.rb
module Jekyll
module Implode
def implode(text)
"['" + text.join("', '") + "']"
end
end
end
Liquid::Template.register_filter(Jekyll::Implode)