LoveIt/layouts/shortcodes/echarts.html
2019-08-24 19:32:41 +08:00

10 lines
No EOL
395 B
HTML

<!-- shuffle md5 as id -->
{{ $id := delimit (split (md5 .Inner) "" | shuffle) "" | printf "ec-%s" -}}
{{ $echartsMap := .Page.Scratch.Get "echartsMap" -}}
{{ if $echartsMap -}}
{{ $echartsMap = dict $id .Inner | merge $echartsMap -}}
{{ else -}}
{{ $echartsMap = dict $id .Inner -}}
{{ end -}}
{{ .Page.Scratch.Set "echartsMap" $echartsMap -}}
<div class="echarts" id="{{ $id }}"></div>