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 }}
|
||||
{{- with $page }}
|
||||
{{- $init := "{}" }}
|
||||
{{- if isset .Params "mathjaxinitialize" }}
|
||||
{{- $.Scratch.Set "mathJaxInitialize" .Params.mathJaxInitialize }}
|
||||
{{- $init = .Params.mathJaxInitialize }}
|
||||
{{- else if isset .Site.Params "mathjaxinitialize" }}
|
||||
{{- $.Scratch.Set "mathJaxInitialize" .Site.Params.mathJaxInitialize }}
|
||||
{{- else }}
|
||||
{{- $.Scratch.Set "mathJaxInitialize" "{}" }}
|
||||
{{- $init = .Site.Params.mathJaxInitialize }}
|
||||
{{- end }}
|
||||
<script>
|
||||
function useMathJax( config ){
|
||||
|
@ -33,7 +32,7 @@
|
|||
}
|
||||
}, config );
|
||||
}
|
||||
useMathJax( JSON.parse({{ $.Scratch.Get "mathJaxInitialize" }}) );
|
||||
useMathJax( JSON.parse({{ $init }}) );
|
||||
</script>
|
||||
{{- if isset .Params "custommathjaxurl" }}
|
||||
<script id="MathJax-script" async src="{{ .Params.customMathJaxURL }}"></script>
|
||||
|
|
|
@ -17,14 +17,13 @@
|
|||
{{- else }}
|
||||
<script src="{{"js/mermaid.min.js" | relURL}}{{ if not .Site.Params.disableAssetsBusting }}?{{ now.Unix }}{{ end }}" defer></script>
|
||||
{{- end }}
|
||||
{{- $init := "{}" }}
|
||||
{{- if isset .Params "mermaidinitialize" }}
|
||||
{{- $.Scratch.Set "mermaidInitialize" .Params.mermaidInitialize }}
|
||||
{{- $init = .Params.mermaidInitialize }}
|
||||
{{- else if isset .Site.Params "mermaidinitialize" }}
|
||||
{{- $.Scratch.Set "mermaidInitialize" .Site.Params.mermaidInitialize }}
|
||||
{{- else }}
|
||||
{{- $.Scratch.Set "mermaidInitialize" "{}" }}
|
||||
{{- $init = .Site.Params.mermaidInitialize }}
|
||||
{{- end }}
|
||||
<script>
|
||||
window.themeUseMermaid = JSON.parse({{ $.Scratch.Get "mermaidInitialize" }});
|
||||
window.themeUseMermaid = JSON.parse({{ $init }});
|
||||
</script>
|
||||
{{- end }}
|
Loading…
Reference in a new issue