2019-02-03 12:30:44 +01:00
|
|
|
{{ $cdn_url := .Scratch.Get "cdn_url" }}
|
|
|
|
{{ $postHasImages := .Scratch.Get "postHasImages"}}
|
2019-08-07 06:31:14 +02:00
|
|
|
|
|
|
|
{{ $scripts := resources.Get "/js/main.js" | slice }}
|
|
|
|
{{ $dynamicToTop := resources.Get "/js/dynamicToTop.min.js" }}
|
2019-08-05 15:15:01 +02:00
|
|
|
{{ $lightGallery_init := resources.Get "/js/lightGallery-init.js" }}
|
2019-02-03 12:30:44 +01:00
|
|
|
|
2019-08-07 06:31:14 +02:00
|
|
|
{{ $jquery := `
|
|
|
|
<script src="https://cdn.jsdelivr.net/npm/jquery@3.4.1/dist/jquery.slim.min.js" integrity="sha256-pasqAKBDmFT4eHoN2ndd6lN370kFiGUFyTiUHWhU7k8=" crossorigin="anonymous"></script>
|
|
|
|
` }}
|
|
|
|
{{ $prettify := `
|
|
|
|
<script src="https://cdn.jsdelivr.net/npm/code-prettify@0.1.0/src/prettify.js" integrity="sha256-w3n8zE0N1lx/nrrWA16Dk7KnySbJF7cPs5E2CByeB7A=" crossorigin="anonymous"></script>
|
|
|
|
` }}
|
|
|
|
{{ $lightGallery := `
|
|
|
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/lightgallery@1.6.12/dist/css/lightgallery.min.css" integrity="sha256-8rfHbJr+ju3Oc099jFJMR1xAPu8CTPHU8uP5J3X/VAY=" crossorigin="anonymous">
|
|
|
|
<script src="https://cdn.jsdelivr.net/npm/lightgallery@1.6.12/dist/js/lightgallery-all.min.js" integrity="sha256-w14QFJrxOYkUnF0hb8pVFCSgYcsF0hMIKrqGb8A7J8A=" crossorigin="anonymous"></script>
|
|
|
|
` }}
|
|
|
|
{{ $lazysizes := `
|
|
|
|
<script src="https://cdn.jsdelivr.net/npm/lazysizes@5.1.1/lazysizes.min.js" integrity="sha256-6zKmNZVeImc0d1Y55vm4So/0W5mbwWiPS4zJt3F4t2A=" crossorigin="anonymous"></script>
|
|
|
|
` }}
|
|
|
|
{{ $katex := `
|
|
|
|
<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>
|
|
|
|
` }}
|
|
|
|
|
|
|
|
<!-- jQuery -->
|
|
|
|
{{ $jquery | safeHTML }}
|
|
|
|
|
2019-08-05 15:15:01 +02:00
|
|
|
{{ if .IsPage }}
|
2019-08-07 06:31:14 +02:00
|
|
|
{{ $prettify | safeHTML }}
|
|
|
|
{{ $scripts = $scripts | append $dynamicToTop }}
|
|
|
|
|
2019-02-03 12:30:44 +01:00
|
|
|
{{ if $postHasImages }}
|
2019-08-07 06:31:14 +02:00
|
|
|
{{ $lightGallery | safeHTML }}
|
|
|
|
{{ $lazysizes | safeHTML }}
|
|
|
|
{{ $scripts = $scripts | append $lightGallery_init }}
|
|
|
|
{{ $scripts = $scripts | resources.Concat "/js/vendor_gallery.js" | resources.Minify }}
|
2019-02-03 12:30:44 +01:00
|
|
|
{{ else }}
|
2019-08-07 06:31:14 +02:00
|
|
|
{{ $scripts = $scripts | resources.Concat "/js/vendor_no_gallery.js" | resources.Minify }}
|
2019-02-03 12:30:44 +01:00
|
|
|
{{ end }}
|
2019-08-04 15:53:35 +02:00
|
|
|
|
2019-08-06 18:16:32 +02:00
|
|
|
<!-- KaTeX -->
|
|
|
|
{{ if or .Params.Math .Site.Params.Math }}
|
2019-08-07 06:31:14 +02:00
|
|
|
{{ $katex | safeHTML }}
|
2019-08-06 18:16:32 +02:00
|
|
|
{{ end }}
|
2019-02-03 12:30:44 +01:00
|
|
|
{{ else }}
|
2019-08-07 06:31:14 +02:00
|
|
|
{{ $scripts = $scripts | resources.Concat "/js/vendor_main.js" | resources.Minify}}
|
2019-03-13 23:35:27 +01:00
|
|
|
{{ end }}
|
2019-03-13 23:38:18 +01:00
|
|
|
|
2019-08-07 06:31:14 +02:00
|
|
|
<script src="{{ printf "%s%s" $cdn_url $scripts.RelPermalink }}" async=""></script>
|
|
|
|
|
2019-03-13 23:38:18 +01:00
|
|
|
{{ template "_internal/google_analytics_async.html" . }}
|