mirror of https://github.com/jpanther/congo.git
✨ Add katex shortcode
parent
40899da9a8
commit
554ae35e6f
|
@ -1,7 +1,6 @@
|
||||||
{{/* Mermaid */}}
|
{{/* Mermaid */}}
|
||||||
{{ if .Page.HasShortcode "mermaid" }}
|
{{ if .Page.HasShortcode "mermaid" }}
|
||||||
{{ $mermaidJS := resources.Get "vendor/mermaid/mermaid.min.js" }}
|
{{ $mermaidJS := resources.Get "vendor/mermaid/mermaid.min.js" }}
|
||||||
{{ if $mermaidJS }}
|
|
||||||
{{ $mermaidJS := $mermaidJS | resources.Fingerprint "sha512" }} <script defer src="{{ $mermaidJS.RelPermalink }}" integrity="{{ $mermaidJS.Data.Integrity }}"></script>
|
{{ $mermaidJS := $mermaidJS | resources.Fingerprint "sha512" }} <script defer src="{{ $mermaidJS.RelPermalink }}" integrity="{{ $mermaidJS.Data.Integrity }}"></script>
|
||||||
<script>
|
<script>
|
||||||
document.addEventListener('DOMContentLoaded', (event) => {
|
document.addEventListener('DOMContentLoaded', (event) => {
|
||||||
|
@ -12,11 +11,9 @@
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ end }}
|
|
||||||
{{/* Chart */}}
|
{{/* Chart */}}
|
||||||
{{ if .Page.HasShortcode "chart" }}
|
{{ if .Page.HasShortcode "chart" }}
|
||||||
{{ $chartJS := resources.Get "vendor/chart/chart.min.js" }}
|
{{ $chartJS := resources.Get "vendor/chart/chart.min.js" }}
|
||||||
{{ if $chartJS }}
|
|
||||||
{{ $chartJS := $chartJS | resources.Fingerprint "sha512" }}
|
{{ $chartJS := $chartJS | resources.Fingerprint "sha512" }}
|
||||||
<script defer src="{{ $chartJS.RelPermalink }}" integrity="{{ $chartJS.Data.Integrity }}"></script>
|
<script defer src="{{ $chartJS.RelPermalink }}" integrity="{{ $chartJS.Data.Integrity }}"></script>
|
||||||
<script>
|
<script>
|
||||||
|
@ -36,4 +33,23 @@
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
{{/* Katex */}}
|
||||||
|
{{ if .Page.HasShortcode "katex" }}
|
||||||
|
{{ $katexCSS := resources.Get "vendor/katex/katex.min.css" }}
|
||||||
|
{{ $katexCSS := $katexCSS | resources.Fingerprint "sha512" }}
|
||||||
|
<link
|
||||||
|
type="text/css" rel="stylesheet"
|
||||||
|
href="{{ $katexCSS.RelPermalink }}"
|
||||||
|
integrity="{{ $katexCSS.Data.Integrity }}"
|
||||||
|
/>
|
||||||
|
{{ $katexJS := resources.Get "vendor/katex/katex.min.js" }}
|
||||||
|
{{ $katexJS := $katexJS | resources.Fingerprint "sha512" }}
|
||||||
|
<script defer src="{{ $katexJS.RelPermalink }}" integrity="{{ $katexJS.Data.Integrity }}"></script>
|
||||||
|
{{ $katexRenderJS := resources.Get "vendor/katex/auto-render.min.js" }}
|
||||||
|
{{ $katexRenderJS := $katexRenderJS | resources.Fingerprint "sha512" }}
|
||||||
|
<script defer src="{{ $katexRenderJS.RelPermalink }}" integrity="{{ $katexRenderJS.Data.Integrity }}" onload="renderMathInElement(document.body);"></script>
|
||||||
|
{{ $katexFonts := resources.Match "vendor/katex/fonts/*" }}
|
||||||
|
{{ range $katexFonts }}
|
||||||
|
<!-- {{ .RelPermalink }} -->
|
||||||
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
{{/* Nothing to see here */}}
|
Loading…
Reference in New Issue