{{ $cdn_url := .Scratch.Get "cdn_url" }}
{{ $postHasImages := .Scratch.Get "postHasImages"}}
{{ $jquery := resources.Get "/js/jquery.min.js" }}
{{ $lazysizes := resources.Get "/js/lazysizes.min.js"}}
{{ $prettify := resources.Get "/js/prettify.min.js" }}
{{ $dynamic := resources.Get "/js/dynamic.to.top.min.js" }}
{{ $main := resources.Get "/js/main.js" }}
{{ $lightGallery := resources.Get "/js/lightGallery-all.min.js" }}
{{ $lightGallery_init := resources.Get "/js/lightGallery-init.js" }}
{{ if .IsPage }}
{{ if $postHasImages }}
{{ $vendorScript := slice $jquery $lazysizes $prettify $dynamic $main $lightGallery $lightGallery_init | resources.Concat "/js/vendor_gallery.js" | resources.Minify }}
{{ else }}
{{ $vendorScript := slice $jquery $prettify $dynamic $main | resources.Concat "/js/vendor_no_gallery.js" | resources.Minify }}
{{ end }}
{{ else }}
{{ $vendorScript := slice $jquery $main | resources.Concat "/js/vendor_main.js" | resources.Minify}}
{{ end }}
{{ template "_internal/google_analytics_async.html" . }}