fix(srcatch): fix srcatch bugs

This commit is contained in:
Dillon
2020-02-27 20:14:40 +08:00
parent 0dc5feb7f3
commit ae81e3767e
32 changed files with 370 additions and 210 deletions

View File

@@ -1,6 +1,5 @@
{{- $scratch := .Page.Scratch.Get "scratch" -}}
{{- /* shuffle md5 as id */ -}}
{{- $id := delimit (split (md5 .Inner) "" | shuffle) "" | printf "mermaid-%s" -}}
{{- $id := partial "function/id.html" (dict "content" (trim .Inner "\n") "scratch" $scratch) -}}
<div class="mermaid" id="{{ $id }}"></div>
{{- $scratch.SetInMap "mermaidMap" $id (trim .Inner "\n") -}}
{{- slice $id | $scratch.Add "mermaidArr" -}}