summaryrefslogtreecommitdiff
path: root/themes/CodeIT/layouts/shortcodes/echarts.html
diff options
context:
space:
mode:
Diffstat (limited to 'themes/CodeIT/layouts/shortcodes/echarts.html')
-rw-r--r--themes/CodeIT/layouts/shortcodes/echarts.html6
1 files changed, 6 insertions, 0 deletions
diff --git a/themes/CodeIT/layouts/shortcodes/echarts.html b/themes/CodeIT/layouts/shortcodes/echarts.html
new file mode 100644
index 0000000..f13be36
--- /dev/null
+++ b/themes/CodeIT/layouts/shortcodes/echarts.html
@@ -0,0 +1,6 @@
+{{- $content := .Inner | transform.Unmarshal | jsonify -}}
+{{- $id := dict "Content" $content "Scratch" .Page.Scratch | partial "function/id.html" -}}
+{{- $width := cond .IsNamedParams (.Get "width") (.Get 0) | default "100%" -}}
+{{- $height := cond .IsNamedParams (.Get "height") (.Get 1) | default "30rem" -}}
+<div class="echarts" id="{{ $id }}" style="width: {{ $width }}; height: {{ $height }};"></div>
+{{- .Page.Scratch.SetInMap "this" "echarts" true -}}