diff options
author | Guillermo Guerrero Ibarra <wolf.fox1985@gmail.com> | 2020-06-30 16:40:37 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-30 16:40:37 +0300 |
commit | f4f4854e9143de5b9b27a8b7e20fd6526bd62d75 (patch) | |
tree | 87bc976d8f38a15a4633d8a666e417afad0c6513 /layouts | |
parent | 0be5f3502a7712aa4ec3ebaa29af572b24a010bf (diff) |
Add google map enable param (#267)
* add googlemap enable in config param
* enable googlemap
* add enableGoogleMaps desc in README.md
* improve Google Maps widget documentation
* Added if condition to div map.
Co-authored-by: helight <helight@helight.info>
Co-authored-by: Salim B <salim@posteo.de>
Diffstat (limited to 'layouts')
-rw-r--r-- | layouts/partials/map.html | 28 | ||||
-rw-r--r-- | layouts/partials/scripts.html | 2 |
2 files changed, 17 insertions, 13 deletions
diff --git a/layouts/partials/map.html b/layouts/partials/map.html index 8df6c23..540546c 100644 --- a/layouts/partials/map.html +++ b/layouts/partials/map.html @@ -1,15 +1,17 @@ -{{ if isset .Site.Params "latitude" }} - {{ if isset .Site.Params "longitude" }} - <div class="hidden"> - <input id="gmap-lat" value="{{ .Site.Params.latitude }}" /> - <input id="gmap-lng" value="{{ .Site.Params.longitude }}" /> - <input id="gmap-marker" value="{{ "img/marker.png" | relURL }}" /> - {{ if isset .Site.Params "direction" }} - <input id="gmap-dir" value="{{ .Site.Params.direction }}" /> - {{ else }} - <input id="gmap-dir" value="{{ .Site.Params.latitude }},{{ .Site.Params.longitude }}" /> - {{ end }} - </div> - <div id="map" /> +{{ if .Site.Params.enableGoogleMaps }} + {{ if isset .Site.Params "latitude" }} + {{ if isset .Site.Params "longitude" }} + <div class="hidden"> + <input id="gmap-lat" value="{{ .Site.Params.latitude }}" /> + <input id="gmap-lng" value="{{ .Site.Params.longitude }}" /> + <input id="gmap-marker" value="{{ "img/marker.png" | relURL }}" /> + {{ if isset .Site.Params "direction" }} + <input id="gmap-dir" value="{{ .Site.Params.direction }}" /> + {{ else }} + <input id="gmap-dir" value="{{ .Site.Params.latitude }},{{ .Site.Params.longitude }}" /> + {{ end }} + </div> + <div id="map" /> + {{ end }} {{ end }} {{ end }} diff --git a/layouts/partials/scripts.html b/layouts/partials/scripts.html index 5b064fb..2b8ca63 100644 --- a/layouts/partials/scripts.html +++ b/layouts/partials/scripts.html @@ -6,6 +6,7 @@ <script src="//cdnjs.cloudflare.com/ajax/libs/waypoints/4.0.1/jquery.waypoints.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/Counter-Up/1.0/jquery.counterup.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/jquery-parallax/1.1.3/jquery-parallax.js"></script> +{{ if .Site.Params.enableGoogleMaps }} {{ if .Site.Params.googleMapsApiKey }} <script src="//maps.googleapis.com/maps/api/js?key={{.Site.Params.googleMapsApiKey}}&v=3.exp"></script> {{ else }} @@ -13,6 +14,7 @@ {{ end }} <script src="{{ "js/hpneo.gmaps.js" | relURL }}"></script> <script src="{{ "js/gmaps.init.js" | relURL }}"></script> +{{ end }} <script src="{{ "js/front.js" | relURL }}"></script> <!-- owl carousel --> |