File tree Expand file tree Collapse file tree 2 files changed +11
-12
lines changed Expand file tree Collapse file tree 2 files changed +11
-12
lines changed Original file line number Diff line number Diff line change 25
25
{{- end -}}
26
26
{{- end -}}
27
27
28
- {{ if .HasShortcode "mermaid" }}
29
- <!-- Copied from https://unpkg.com/[email protected] /dist/mermaid.min.js -->
30
- {{- with resources.Get "js/mermaid-10.6.1.min.js" -}}
31
- < script src ="{{ .RelPermalink }} " integrity ="sha384-toDgDinNQVuBBJdT9Q9AnvM4szGg0g7BSEy/yLPRkkQylpeePcz8Mx/JLOFf33o+ "> </ script >
32
- {{- else -}}
33
- <!-- without Mermaid, the site won't appear right -->
34
- {{- errorf "No Mermaid helper script found" -}}
35
- {{- end -}}
36
- {{- end -}}
37
-
38
28
{{- if eq .Layout "glossary" -}}
39
29
{{- with resources.Get "js/glossary.js" -}}
40
30
< script defer src ="{{ .RelPermalink }} "> </ script >
Original file line number Diff line number Diff line change 1
1
< script src ="{{ "js /script.js" | relURL }}"> </ script >
2
2
3
+ {{/* Handle legacy Kubernetes shortcode for Mermaid diagrams */}}
4
+ {{- if (.HasShortcode "mermaid") -}}
5
+ {{ .Page.Store.Set "hasmermaid" true -}}
6
+ {{- end -}}
7
+
8
+ {{/* future Docsy versions move this to partials/mermaid.html */}}
9
+ {{- if .Page.Store.Get "hasmermaid" -}}
10
+ < script src ="
https://cdn.jsdelivr.net/npm/[email protected] /dist/mermaid.min.js "
integrity ="
sha512-IX+bU+wShHqfqaMHLMrtwi4nK6W/Z+QdZoL4kPNtRxI2wCLyHPMAdl3a43Fv1Foqv4AP+aiW6hg1dcrTt3xc+Q== "
crossorigin ="
anonymous "
> </ script >
11
+ {{- end }}
12
+
3
13
{{ $jsBs := resources.Get "vendor/bootstrap/dist/js/bootstrap.bundle.js" -}}
4
14
{{ $jsBase := resources.Get "js/base.js" }}
5
15
{{ $jsAnchor := resources.Get "js/anchor.js" }}
6
16
{{ $jsSearch := resources.Get "js/search.js" | resources.ExecuteAsTemplate "js/search.js" .Site.Home }}
7
- {{ $jsMermaid := resources.Get "js/mermaid.js" | resources.ExecuteAsTemplate "js/mermaid.js" . }}
8
17
{{ if .Site.Params.offlineSearch }}
9
18
{{ $jsSearch = resources.Get "js/offline-search.js" }}
10
19
{{ end }}
11
- {{ $js := (slice $jsBs $jsBase $jsAnchor $jsSearch $jsMermaid ) | resources.Concat "js/main.js" -}}
20
+ {{ $js := (slice $jsBs $jsBase $jsAnchor $jsSearch) | resources.Concat "js/main.js" -}}
12
21
{{ if hugo.IsProduction -}}
13
22
{{ $js := $js | minify | fingerprint -}}
14
23
< script src ="{{ $js.RelPermalink }} " integrity ="{{ $js.Data.Integrity }} " crossorigin ="anonymous "> </ script >
You can’t perform that action at this time.
0 commit comments