Load google maps api key from config

This commit is contained in:
2015-12-22 10:33:45 +00:00
parent afb1180177
commit 4b03ac6296
4 changed files with 9 additions and 42 deletions

View File

@@ -1,11 +1,18 @@
# location
absolute: http://localhost absolute: http://localhost
baseurl: jekyll baseurl: jekyll
# variables
title: Rik @ St Andrews title: Rik @ St Andrews
author: Rik Veenboer author: Rik Veenboer
email: rik.veenboer@gmail.com email: rik.veenboer@gmail.com
github: https://github.com/boukefalos github: https://github.com/boukefalos
disqus: boukefalos disqus: boukefalos
analytics: UA-46375339-1 analytics: UA-46375339-1
maps: AIzaSyCyIwGR-F48dFjAbwNr9JdOsfUYaUQxz1s
# other
gems: [jekyll-paginate]
markdown: redcarpet markdown: redcarpet
paginate: 7 paginate: 7
highlighter: pygments highlighter: pygments

View File

@@ -3,7 +3,7 @@ layout: post
--- ---
{% capture gallery %}{{ page.url|replace:'/map.html',''|remove_first:'/' }}{% endcapture %} {% capture gallery %}{{ page.url|replace:'/map.html',''|remove_first:'/' }}{% endcapture %}
<div id="googlemap" style="height:400px;margin-top:8px;"></div> <div id="googlemap" style="height:400px;margin-top:8px;"></div>
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBDIwEZirrDvuvDkhTtON8OqpmH7jP7DW4&amp;sensor=false"></script> <script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key={{ site.maps }}&amp;sensor=false"></script>
<script type="text/javascript"> <script type="text/javascript">
google.maps.event.addDomListener( google.maps.event.addDomListener(
window, window,

View File

@@ -3,47 +3,6 @@
module Jekyll module Jekyll
module Tags module Tags
class PostComparer
MATCHER = /^(.+\/)*(\d+-\d+-\d+)-(.*)$/
attr_reader :path, :date, :slug, :name
def initialize(name)
@name = name
all, @path, @date, @slug = *name.sub(/^\//, "").match(MATCHER)
raise ArgumentError.new("'#{name}' does not contain valid date and/or title.") unless all
@name_regex = /^#{path}#{date}-#{slug}\.[^.]+/
end
def ==(other)
other.basename.match(@name_regex)
end
def deprecated_equality(other)
date = Utils.parse_date(name, "'#{name}' does not contain valid date and/or title.")
slug == post_slug(other) &&
date.year == other.date.year &&
date.month == other.date.month &&
date.day == other.date.day
end
private
# Construct the directory-aware post slug for a Jekyll::Post
#
# other - the Jekyll::Post
#
# Returns the post slug with the subdirectory (relative to _posts)
def post_slug(other)
path = other.basename.split("/")[0...-1].join("/")
if path.nil? || path == ""
other.data['slug']
else
path + '/' + other.data['slug']
end
end
end
class PostBastUrl < Liquid::Tag class PostBastUrl < Liquid::Tag
def initialize(tag_name, post, tokens) def initialize(tag_name, post, tokens)
super super

View File

@@ -3,6 +3,7 @@ id: 3227
title: Coastal path title: Coastal path
author: Rik author: Rik
layout: post layout: post
description: Een winterse wandeling over het coastal path.
--- ---
De Schotse winter is vreemd, het ene weekend sneeuwt het en liggen de temperaturen rond het vriespunt, het volgende waait het alsof we nog wat herfst tegoed hebben en is het bijna 10 °C. De Schotse winter is vreemd, het ene weekend sneeuwt het en liggen de temperaturen rond het vriespunt, het volgende waait het alsof we nog wat herfst tegoed hebben en is het bijna 10 °C.