|
@@ -47,6 +47,12 @@
|
|
|
<meta name="theme-color" content="{{ $scr.Get "primary" }}">
|
|
|
{{ end }}
|
|
|
|
|
|
+ {{/* Config LaTeX math rendering. */}}
|
|
|
+ {{ if or .Params.math site.Params.math }}
|
|
|
+ {{ $mathjax_config := resources.Get "js/mathjax-config.js" }}
|
|
|
+ <script src="{{ $mathjax_config.RelPermalink }}"></script>
|
|
|
+ {{ end }}
|
|
|
+
|
|
|
{{/* Attempt to load local vendor CSS, otherwise load from CDN. */}}
|
|
|
{{ $scr.Set "vendor_css_filename" "main.min.css" }}
|
|
|
{{ $scr.Set "vendor_js_filename" "main.min.js" }}
|
|
@@ -92,6 +98,20 @@
|
|
|
{{ printf "<link rel=\"stylesheet\" href=\"%s\" integrity=\"%s\" crossorigin=\"anonymous\">" (printf $css.instantsearchTheme.url $css.instantsearchTheme.version) $css.instantsearchTheme.sri | safeHTML }}
|
|
|
{{ end }}
|
|
|
|
|
|
+ {{/* Load async scripts. */}}
|
|
|
+ {{ range $k, $v := site.Data.assets.js }}{{/* TODO: investigate why `where ... "async" true` does not work. */}}
|
|
|
+ {{ $load := $v.async }}
|
|
|
+
|
|
|
+ {{/* Only load MathJax if required. */}}
|
|
|
+ {{ if (eq $k "mathJax") | and (not (or $.Params.math site.Params.math)) }}
|
|
|
+ {{ $load = false }}
|
|
|
+ {{end}}
|
|
|
+
|
|
|
+ {{ if $load }}
|
|
|
+ {{ printf "<script src=\"%s\" integrity=\"%s\" crossorigin=\"anonymous\" async></script>" (printf $v.url $v.version) $v.sri | safeHTML }}
|
|
|
+ {{end}}
|
|
|
+ {{end}}
|
|
|
+
|
|
|
{{ end }}
|
|
|
|
|
|
{{/* We cannot use SRI with Google Fonts because the CSS is dynamically generated according to the user agent. */}}
|