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

github.com/saey55/hugo-elate-theme.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsaey55 <saey55@users.noreply.github.com>2018-10-17 20:18:36 +0300
committerGitHub <noreply@github.com>2018-10-17 20:18:36 +0300
commit0efd1de1883a80e9546660bb7c5a879b22fb78b3 (patch)
tree0e9a992a67f5c1673f83f3b3ccea5fee11b7c560
parentccc5bfa019276c1bba066c0a13b8881259c22910 (diff)
parent14efc13f3712af7b67fcea3d580e55b077a24c15 (diff)
Merge pull request #38 from denisazevedo/master
fix #37 add config key for Google Maps Javascript API Key
-rw-r--r--exampleSite/config.toml4
-rwxr-xr-xlayouts/partials/js.html6
2 files changed, 9 insertions, 1 deletions
diff --git a/exampleSite/config.toml b/exampleSite/config.toml
index f8fc2c5..9340b3a 100644
--- a/exampleSite/config.toml
+++ b/exampleSite/config.toml
@@ -12,6 +12,10 @@ theme = "hugo-elate-theme"
author = ""
description = ""
email = ""
+
+ # Google Maps Javascript API Key (if not set will default to not passing a key)
+ googleMapsApiKey = ""
+
# Navigation
[params.navigation]
brand = "Elate"
diff --git a/layouts/partials/js.html b/layouts/partials/js.html
index 11a6392..0bd7440 100755
--- a/layouts/partials/js.html
+++ b/layouts/partials/js.html
@@ -15,7 +15,11 @@
<script src="js/magnific-popup-options.js"></script>
<!-- Google Map -->
{{ if .Site.Params.contact.map }}
- <script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyCefOgb1ZWqYtj7raVSmN4PL2WkTrc-KyA&sensor=false"></script>
+ {{ if .Site.Params.googleMapsApiKey }}
+ <script src="https://maps.googleapis.com/maps/api/js?key={{ .Site.Params.googleMapsApiKey }}"></script>
+ {{ else }}
+ <script src="https://maps.googleapis.com/maps/api/js"></script>
+ {{ end }}
<script src="js/google_map.js"></script>
{{ end }}
<!-- Main JavaScript -->