Docs: update theme (#368)

Signed-off-by: Carson Yang <yangchuansheng33@gmail.com>
This commit is contained in:
Carson Yang
2023-10-04 22:25:07 +08:00
committed by GitHub
parent bf172fab81
commit 7f1fecb84e
8 changed files with 56 additions and 16 deletions

View File

@@ -11,8 +11,12 @@
{{ end -}}
{{ if .Page.Store.Get "hasMermaid" }}
<script type="module">
import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.esm.min.mjs';
{{ $mermaid := resources.Get (printf "%s/%s" ($.Scratch.Get "pathName") "js/mermaid.js") }}
{{ if hugo.IsProduction }}
{{ $mermaid = $mermaid | minify | fingerprint "sha384" }}
{{ end }}
<script src="{{ $mermaid.RelPermalink }}" {{ if hugo.IsProduction }}integrity="{{ $mermaid.Data.Integrity }}"{{ end }}></script>
<script>
const config = {
startOnLoad:true,
logLevel: "error",