2021-11-03 05:52:40 +00:00
|
|
|
{{/* Mermaid */}}
|
|
|
|
{{ if .Page.HasShortcode "mermaid" }}
|
2022-01-12 00:20:59 +00:00
|
|
|
{{ $mermaidLib := resources.Get "lib/mermaid/mermaid.min.js" }}
|
|
|
|
{{ $mermaidConfig := resources.Get "js/mermaid.js" }}
|
|
|
|
{{ $mermaidConfig := $mermaidConfig | resources.Minify }}
|
|
|
|
{{ $mermaidJS := slice $mermaidLib $mermaidConfig | resources.Concat "js/mermaid.bundle.js" | resources.Fingerprint "sha512" }}
|
|
|
|
<script defer type="text/javascript" src="{{ $mermaidJS.RelPermalink }}" integrity="{{ $mermaidJS.Data.Integrity }}"></script>
|
2021-11-03 05:52:40 +00:00
|
|
|
{{ end }}
|
|
|
|
{{/* Chart */}}
|
|
|
|
{{ if .Page.HasShortcode "chart" }}
|
2022-11-21 02:56:13 +00:00
|
|
|
{{ $chartLib := resources.Get "lib/chart/chart.umd.js" }}
|
2022-01-12 00:20:59 +00:00
|
|
|
{{ $chartConfig := resources.Get "js/chart.js" }}
|
|
|
|
{{ $chartConfig := $chartConfig | resources.Minify }}
|
|
|
|
{{ $chartJS := slice $chartLib $chartConfig | resources.Concat "js/chart.bundle.js" | resources.Fingerprint "sha512" }}
|
|
|
|
<script defer type="text/javascript" src="{{ $chartJS.RelPermalink }}" integrity="{{ $chartJS.Data.Integrity }}"></script>
|
2021-11-03 23:06:52 +00:00
|
|
|
{{ end }}
|
|
|
|
{{/* Katex */}}
|
2023-08-24 22:55:29 +00:00
|
|
|
{{ if or (.Page.HasShortcode "katexblock") (.Page.HasShortcode "katexinline") }}
|
2021-11-04 03:19:02 +00:00
|
|
|
{{ $katexCSS := resources.Get "lib/katex/katex.min.css" }}
|
2021-11-03 23:06:52 +00:00
|
|
|
{{ $katexCSS := $katexCSS | resources.Fingerprint "sha512" }}
|
|
|
|
<link
|
|
|
|
type="text/css" rel="stylesheet"
|
|
|
|
href="{{ $katexCSS.RelPermalink }}"
|
|
|
|
integrity="{{ $katexCSS.Data.Integrity }}"
|
|
|
|
/>
|
2021-11-04 03:19:02 +00:00
|
|
|
{{ $katexJS := resources.Get "lib/katex/katex.min.js" }}
|
2021-11-03 23:06:52 +00:00
|
|
|
{{ $katexJS := $katexJS | resources.Fingerprint "sha512" }}
|
|
|
|
<script defer src="{{ $katexJS.RelPermalink }}" integrity="{{ $katexJS.Data.Integrity }}"></script>
|
2021-11-04 03:19:02 +00:00
|
|
|
{{ $katexRenderJS := resources.Get "lib/katex/auto-render.min.js" }}
|
2021-11-03 23:06:52 +00:00
|
|
|
{{ $katexRenderJS := $katexRenderJS | resources.Fingerprint "sha512" }}
|
|
|
|
<script defer src="{{ $katexRenderJS.RelPermalink }}" integrity="{{ $katexRenderJS.Data.Integrity }}" onload="renderMathInElement(document.body);"></script>
|
2021-11-04 03:19:02 +00:00
|
|
|
{{ $katexFonts := resources.Match "lib/katex/fonts/*" }}
|
2021-11-03 23:06:52 +00:00
|
|
|
{{ range $katexFonts }}
|
2022-11-21 02:56:13 +00:00
|
|
|
{{ .Publish }}
|
2021-11-03 05:52:40 +00:00
|
|
|
{{ end }}
|
|
|
|
{{ end }}
|