{{ $isLeafletNeeded := false }} {{ if .Params.contents }} {{ range .Params.contents }} {{ if or (eq .template "locations") (eq .template "organizations") }} {{ with .data }} {{ if eq .layout "map" }} {{ $isLeafletNeeded = true }} {{ end }} {{ end }} {{ end }} {{ end }} {{ end }} {{ if and (eq .Kind "taxonomy") (eq .Section "locations") }} {{ $isLeafletNeeded = true }} {{ end }} {{ if .Params.contact_details.postal_address.geolocation }} {{ $isLeafletNeeded = true }} {{ end }} {{ if $isLeafletNeeded }} {{- $cssOpts := (dict "targetPath" "assets/css/leaflet.css" "enableSourceMap" true "includePaths" (slice "node_modules") ) -}} {{- $styles := resources.Get "sass/_theme/dependencies/leaflet.sass" | toCSS $cssOpts -}} {{ if hugo.IsProduction }} {{- $styles = resources.Get "sass/_theme/dependencies/leaflet.sass" | toCSS $cssOpts | postCSS | minify | fingerprint -}} {{ end }} {{ $leaflet_js := resources.Get "js/vendors/leaflet.js" | js.Build (dict "minify" hugo.IsProduction) | fingerprint }} {{ end }} {{ $build_options := (dict "minify" hugo.IsProduction "params" (dict "i18n" (dict "slider" (dict "default_title" (i18n "commons.slider.default_title") "goto" (i18n "commons.slider.goto") "next" (i18n "commons.slider.next") "pagination_list" (i18n "commons.slider.pagination_list") "pause" (i18n "commons.slider.pause") "play" (i18n "commons.slider.play") "previous" (i18n "commons.slider.previous") ) "lightbox" (dict "default_alt" (i18n "commons.lightbox.default_alt") ) "maps" (dict "attribution_title" (i18n "commons.maps.attribution_title") "marker_label" (i18n "commons.maps.marker_label") "popup_close" (i18n "commons.maps.popup_close") "zoom_in" (i18n "commons.maps.zoom_in") "zoom_out" (i18n "commons.maps.zoom_out") ) ) ) )}} {{ $js := resources.Get "js/main.js" | js.Build $build_options | fingerprint }}