File size: 3,759 Bytes
bc8bf33
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
{{ "<!-- js.html -->" | safeHTML }}
{{- $js_files := slice
    (resources.Get "js/default.js")
    (resources.Get "js/accessibility.js")
    (resources.Get "js/bionread.js")
}}

{{- if site.Params.posts.colophon }}
    {{- $js_files = $js_files | append (resources.Get "js/qrcode.js") }}
{{- end }}

{{- $hugo_brewm := $js_files | resources.Concat "js/hugo-brewm.js" | minify }}
{{- if eq hugo.Environment "development" }}
    <script src="{{ $hugo_brewm.Permalink }}" defer></script>
{{- else }}
    {{- with $hugo_brewm | fingerprint "sha384" -}}
        <script src="{{ $hugo_brewm.Permalink }}"
            integrity="{{ .Data.Integrity }}" crossorigin="anonymous"
            defer></script>
    {{- end }}
{{- end }}

{{- /*----------------------- end of js.html -----------------------*/}}

{{- define "partials/head/js/hljs.html" -}}
    {{ "<!-- hljs.html -->" | safeHTML }}
    <script src="https://cdn.jsdelivr.net/gh/highlightjs/[email protected]/build/highlight.min.js"
        integrity="sha384-4l+9bhb7rakZ18megzl0/DWczL8ojbDl1jIEzBVffeMho9A6xB/lkqt1K0PC8Jin" crossorigin="anonymous"></script>
    <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/highlightjs-line-numbers.min.js"
        integrity="sha384-+ch8x/dgaV//v6Sa8m4v5+7KScnpCuxHqilN8njQ013CEKg3Fbd8Q3oN9tfpouLh" crossorigin="anonymous"
        onload="hljs.highlightAll(); hljs.initLineNumbersOnLoad();"></script>
    {{- if .Params.Hljslang }}
        <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/highlightjs-lang.min.js"
            integrity="sha384-75WGRpKMq3Y83/0jMJ4YeuDd3z48ZvyiFJCYsGoGuE3s8D1P3AiXa6CLxc1wO//W" crossorigin="anonymous"
            onload="hljs.initLangOnLoad();"></script>
    {{- end }}
{{- end }}

{{- define "partials/head/js/katex.html" -}}
    {{ "<!-- katex.html -->" | safeHTML }}
    <link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.css" rel="stylesheet"
        integrity="sha384-vKruj+a13U8yHIkAyGgK1J3ArTLzrFGBbBc0tDp4ad/EyewESeXE/Iv67Aj8gKZ0" crossorigin="anonymous">
    <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.js"
        integrity="sha384-PwRUT/YqbnEjkZO0zZxNqcxACrXe+j766U2amXcgMg5457rve2Y7I6ZJSm2A0mS4" crossorigin="anonymous"
        defer></script>
    <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/contrib/auto-render.min.js"
        integrity="sha384-+VBxd3r6XgURycqtZ117nYw44OOcIax56Z4dCRWbxyPt0Koah1uHoK0o4+/RRE05" crossorigin="anonymous"
        onload="renderMathInElement(document.body);"
        defer></script>
    <script src="/js/katex.js" defer></script>
{{- end }}

{{- define "partials/head/js/mathjax.html" -}}
    {{ "<!-- mathjax.html -->" | safeHTML }}
    <script src="https://polyfill.io/v3/polyfill.min.js?features=es6"
        integrity="sha384-WSLBwI+Q8tqRHaC+f1sjS/FVv5cWp7VAfrGB17HLfZlXhbp5F/RPVP7bYVHtiAWE"
        crossorigin="anonymous"></script>
    <script src="/js/mathjax.js" defer></script>
    <script
        id="MathJax-script"
        src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"
        integrity="sha384-Wuix6BuhrWbjDBs24bXrjf4ZQ5aFeFWBuKkFekO2t8xFU0iNaLQfp2K6/1Nxveei" crossorigin="anonymous"
        async></script>
{{- end }}

{{- define "partials/head/js/qrcode.html" -}}
    {{ "<!-- qrcode.html -->" | safeHTML }}
    {{ $qrcode := resources.Get "js/qrcode.js" | minify }}
    {{ if eq hugo.Environment "development" }}
        <script src="{{ $qrcode.Permalink }}" defer></script>
    {{- else }}
        {{- with $qrcode | fingerprint "sha384" -}}
            <script src="{{ $qrcode.Permalink }}"
                integrity="{{ .Data.Integrity }}" crossorigin="anonymous"
                defer></script>
        {{- end }}
    {{- end }}
{{- end }}