mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2025-01-18 19:00:24 +00:00
theme: reduce calls to output-format.hugo #380
This commit is contained in:
parent
972fc38d3f
commit
86f3163515
1 changed files with 4 additions and 3 deletions
|
@ -6,7 +6,8 @@
|
|||
<script src="{{"js/clipboard.min.js" | relURL}}{{ if not .Site.Params.disableAssetsBusting }}?{{ now.Unix }}{{ end }}" defer></script>
|
||||
<script src="{{"js/perfect-scrollbar.min.js" | relURL}}{{ if not .Site.Params.disableAssetsBusting }}?{{ now.Unix }}{{ end }}" defer></script>
|
||||
<script src="{{"js/featherlight.min.js" | relURL}}{{ if not .Site.Params.disableAssetsBusting }}?{{ now.Unix }}{{ end }}" defer></script>
|
||||
{{- $wantsMathJax := or (.Page.Store.Get "hasMathJax") (and (.Page.Store.Get (printf "%sIsNested" (partial "output-format.hugo" .Page))) (.Page.Store.Get "nestedHasMathJax")) }}
|
||||
{{- $outputFormat := partial "output-format.hugo" .Page }}
|
||||
{{- $wantsMathJax := or (.Page.Store.Get "hasMathJax") (and (.Page.Store.Get (printf "%sIsNested" $outputFormat)) (.Page.Store.Get "nestedHasMathJax")) }}
|
||||
{{- if $wantsMathJax }}
|
||||
{{- if isset .Params "mathjaxinitialize" }}
|
||||
{{- $.Scratch.Set "mathJaxInitialize" .Params.mathJaxInitialize }}
|
||||
|
@ -51,7 +52,7 @@
|
|||
<script id="MathJax-script" async src="{{"js/mathjax/tex-mml-chtml.js" | relURL}}{{ if not .Site.Params.disableAssetsBusting }}?{{ now.Unix }}{{ end }}"></script>
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- $wantsMermaid := or (.Page.Store.Get "hasMermaid") (and (.Page.Store.Get (printf "%sIsNested" (partial "output-format.hugo" .Page))) (.Page.Store.Get "nestedHasMermaid")) }}
|
||||
{{- $wantsMermaid := or (.Page.Store.Get "hasMermaid") (and (.Page.Store.Get (printf "%sIsNested" $outputFormat)) (.Page.Store.Get "nestedHasMermaid")) }}
|
||||
{{- if $wantsMermaid }}
|
||||
<script src="{{"js/jquery.svg.pan.zoom.js" | relURL}}{{ if not .Site.Params.disableAssetsBusting }}?{{ now.Unix }}{{ end }}" defer></script>
|
||||
{{- if isset .Params "custommermaidurl" }}
|
||||
|
@ -72,7 +73,7 @@
|
|||
window.themeUseMermaid = JSON.parse({{ $.Scratch.Get "mermaidInitialize" }});
|
||||
</script>
|
||||
{{- end }}
|
||||
{{- $wantsSwagger := or (.Page.Store.Get "hasSwagger") (and (.Page.Store.Get (printf "%sIsNested" (partial "output-format.hugo" .Page))) (.Page.Store.Get "nestedHasSwagger")) }}
|
||||
{{- $wantsSwagger := or (.Page.Store.Get "hasSwagger") (and (.Page.Store.Get (printf "%sIsNested" $outputFormat)) (.Page.Store.Get "nestedHasSwagger")) }}
|
||||
{{- if $wantsSwagger }}
|
||||
{{- if isset .Params "customswaggerurl" }}
|
||||
<script src="{{ .Params.customSwaggerURL }}" defer></script>
|
||||
|
|
Loading…
Reference in a new issue