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:
authorDenis C de Azevedo <denis.azevedo@gmail.com>2018-10-17 02:00:44 +0300
committerDenis C de Azevedo <denis.azevedo@gmail.com>2018-10-17 02:00:44 +0300
commit14efc13f3712af7b67fcea3d580e55b077a24c15 (patch)
tree0e9a992a67f5c1673f83f3b3ccea5fee11b7c560
parentccc5bfa019276c1bba066c0a13b8881259c22910 (diff)
add config key for Google Maps Javascript API Key
An API key is now required, see this issue: #37. Also, sensor param is not required, recommended to remove, see SensorNotRequired in https://developers.google.com/maps/documentation/javascript/error-messages
-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 -->