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

github.com/jweslley/hugo-conference.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonhnny Weslley <jw@jonhnnyweslley.net>2018-02-04 16:59:48 +0300
committerJonhnny Weslley <jw@jonhnnyweslley.net>2018-02-04 16:59:54 +0300
commit911c94661127bc4c7e938721567643164681fba5 (patch)
tree7ee9dc89ab4f86f466dc3d1a7fc52785240d5437
parente5be69d7d383a03e1b5bd3134d2dcf5baacba278 (diff)
allows to configure Google Maps API Key
Close #2 Thanks to @ls6
-rw-r--r--README.md4
-rw-r--r--exampleSite/config.yml1
-rw-r--r--layouts/index.html4
3 files changed, 8 insertions, 1 deletions
diff --git a/README.md b/README.md
index aaa1e51..c009f99 100644
--- a/README.md
+++ b/README.md
@@ -32,6 +32,10 @@ By default, the site have the following sections:
Ps: It's important to change the `baseurl` property from `config.yml` file in order to reflect your settings.
+### Google Maps
+
+Google now requires a Google Maps JavaScript API Key to show maps. You can obtain your key [here](https://developers.google.com/maps/documentation/javascript/get-api-key). Then set your API key in the `GoogleMapsKey` param in the `config.yml` file.
+
## License
MIT, see [LICENSE](https://github.com/jweslley/hugo-conference/blob/master/LICENSE).
diff --git a/exampleSite/config.yml b/exampleSite/config.yml
index d017dc7..d80c6c6 100644
--- a/exampleSite/config.yml
+++ b/exampleSite/config.yml
@@ -16,6 +16,7 @@ params:
City: "CancĂșn"
State: "Quintana"
Images: ["/img/badge.jpg"]
+ GoogleMapsKey: "my-secret-maps-key"
# Active sections on the website to deactivate comment out with '#'
# you can also change order here and it will reflect on page
diff --git a/layouts/index.html b/layouts/index.html
index ce43462..5202808 100644
--- a/layouts/index.html
+++ b/layouts/index.html
@@ -43,9 +43,11 @@
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="/js/jquery.js"><\/script>')</script>
{{ if isset .Site.Params "address" }}
- <script src="https://maps.google.com/maps/api/js?sensor=false"></script>
+ {{ with .Site.Params.GoogleMapsKey }}
+ <script src="https://maps.google.com/maps/api/js?key={{ . }}"></script>
<script src="/js/main.js"></script>
{{ end }}
+ {{ end }}
{{ template "_internal/google_analytics_async.html" . }}
</body>
</html>