mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-23 07:47:54 +00:00
dependencies: fix mermaid and mathjax initialization #682
caused the stylesheet generator to ignore clicks
This commit is contained in:
parent
d2583cf498
commit
5a534d02b2
2 changed files with 8 additions and 10 deletions
|
@ -1,11 +1,10 @@
|
||||||
{{- $page := .page }}
|
{{- $page := .page }}
|
||||||
{{- with $page }}
|
{{- with $page }}
|
||||||
|
{{- $init := "{}" }}
|
||||||
{{- if isset .Params "mathjaxinitialize" }}
|
{{- if isset .Params "mathjaxinitialize" }}
|
||||||
{{- $.Scratch.Set "mathJaxInitialize" .Params.mathJaxInitialize }}
|
{{- $init = .Params.mathJaxInitialize }}
|
||||||
{{- else if isset .Site.Params "mathjaxinitialize" }}
|
{{- else if isset .Site.Params "mathjaxinitialize" }}
|
||||||
{{- $.Scratch.Set "mathJaxInitialize" .Site.Params.mathJaxInitialize }}
|
{{- $init = .Site.Params.mathJaxInitialize }}
|
||||||
{{- else }}
|
|
||||||
{{- $.Scratch.Set "mathJaxInitialize" "{}" }}
|
|
||||||
{{- end }}
|
{{- end }}
|
||||||
<script>
|
<script>
|
||||||
function useMathJax( config ){
|
function useMathJax( config ){
|
||||||
|
@ -33,7 +32,7 @@
|
||||||
}
|
}
|
||||||
}, config );
|
}, config );
|
||||||
}
|
}
|
||||||
useMathJax( JSON.parse({{ $.Scratch.Get "mathJaxInitialize" }}) );
|
useMathJax( JSON.parse({{ $init }}) );
|
||||||
</script>
|
</script>
|
||||||
{{- if isset .Params "custommathjaxurl" }}
|
{{- if isset .Params "custommathjaxurl" }}
|
||||||
<script id="MathJax-script" async src="{{ .Params.customMathJaxURL }}"></script>
|
<script id="MathJax-script" async src="{{ .Params.customMathJaxURL }}"></script>
|
||||||
|
|
|
@ -17,14 +17,13 @@
|
||||||
{{- else }}
|
{{- else }}
|
||||||
<script src="{{"js/mermaid.min.js" | relURL}}{{ if not .Site.Params.disableAssetsBusting }}?{{ now.Unix }}{{ end }}" defer></script>
|
<script src="{{"js/mermaid.min.js" | relURL}}{{ if not .Site.Params.disableAssetsBusting }}?{{ now.Unix }}{{ end }}" defer></script>
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
{{- $init := "{}" }}
|
||||||
{{- if isset .Params "mermaidinitialize" }}
|
{{- if isset .Params "mermaidinitialize" }}
|
||||||
{{- $.Scratch.Set "mermaidInitialize" .Params.mermaidInitialize }}
|
{{- $init = .Params.mermaidInitialize }}
|
||||||
{{- else if isset .Site.Params "mermaidinitialize" }}
|
{{- else if isset .Site.Params "mermaidinitialize" }}
|
||||||
{{- $.Scratch.Set "mermaidInitialize" .Site.Params.mermaidInitialize }}
|
{{- $init = .Site.Params.mermaidInitialize }}
|
||||||
{{- else }}
|
|
||||||
{{- $.Scratch.Set "mermaidInitialize" "{}" }}
|
|
||||||
{{- end }}
|
{{- end }}
|
||||||
<script>
|
<script>
|
||||||
window.themeUseMermaid = JSON.parse({{ $.Scratch.Get "mermaidInitialize" }});
|
window.themeUseMermaid = JSON.parse({{ $init }});
|
||||||
</script>
|
</script>
|
||||||
{{- end }}
|
{{- end }}
|
Loading…
Reference in a new issue