LoveIt/layouts/partials/js.html

30 lines
2.1 KiB
HTML
Raw Normal View History

2019-02-03 12:30:44 +01:00
{{ $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" }}
2019-08-05 15:15:01 +02:00
{{ $lightGallery := resources.Get "/js/lightGallery-all.min.js" }}
{{ $lightGallery_init := resources.Get "/js/lightGallery-init.js" }}
2019-02-03 12:30:44 +01:00
2019-08-05 15:15:01 +02:00
{{ if .IsPage }}
2019-02-03 12:30:44 +01:00
{{ if $postHasImages }}
2019-08-05 15:15:01 +02:00
<link href="https://cdn.bootcss.com/lightgallery/1.6.12/css/lightgallery.min.css" rel="stylesheet">
{{ $vendorScript := slice $jquery $lazysizes $prettify $dynamic $main $lightGallery $lightGallery_init | resources.Concat "/js/vendor_gallery.js" | resources.Minify }}
<script src="{{ printf "%s%s" $cdn_url $vendorScript.RelPermalink }}" async=""></script>
2019-02-03 12:30:44 +01:00
{{ else }}
2019-08-05 15:15:01 +02:00
{{ $vendorScript := slice $jquery $prettify $dynamic $main | resources.Concat "/js/vendor_no_gallery.js" | resources.Minify }}
<script src="{{ printf "%s%s" $cdn_url $vendorScript.RelPermalink }}" async=""></script>
2019-02-03 12:30:44 +01:00
{{ end }}
2019-08-04 15:53:35 +02:00
2019-08-05 15:15:01 +02:00
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.10.2/dist/katex.min.css" integrity="sha384-yFRtMMDnQtDRO8rLpMIKrtPCD5jdktao2TV19YiZYWMDkUR5GQZR/NOVTdquEx1j" crossorigin="anonymous">
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.10.2/dist/katex.min.js" integrity="sha384-9Nhn55MVVN0/4OFx7EE5kpFBPsEMZxKTCnA+4fqDmg12eCTqGi6+BB2LjY8brQxJ" crossorigin="anonymous"></script>
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.10.2/dist/contrib/auto-render.min.js" integrity="sha384-kWPLUVMOks5AQFrykwIup5lo0m3iMkkHrD0uJ4H5cjeGihAutqP0yW0J6dpFiVkI" crossorigin="anonymous" onload="renderMathInElement(document.body);"></script>
2019-02-03 12:30:44 +01:00
{{ else }}
2019-08-05 15:15:01 +02:00
{{ $vendorScript := slice $jquery $main | resources.Concat "/js/vendor_main.js" | resources.Minify}}
<script src="{{ printf "%s%s" $cdn_url $vendorScript.RelPermalink }}" async=""></script>
{{ end }}
{{ template "_internal/google_analytics_async.html" . }}