Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/uPagge/uBlogger.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDillon <dillonzq@outlook.com>2020-03-21 15:52:12 +0300
committerGitHub <noreply@github.com>2020-03-21 15:52:12 +0300
commitb6ce753ae7892839899962b879e2cc5808c60732 (patch)
tree7faafbb7c91de49ea96fa44d3727cc4018c1f07c /layouts
parentaed8734d83cf68df3b8dc62b27c37888c5cc9569 (diff)
feat(shortcodes): add width and height params for echarts shortc… (#192)
Diffstat (limited to 'layouts')
-rw-r--r--layouts/shortcodes/echarts.html4
1 files changed, 3 insertions, 1 deletions
diff --git a/layouts/shortcodes/echarts.html b/layouts/shortcodes/echarts.html
index 4f24b26..ec0e4c8 100644
--- a/layouts/shortcodes/echarts.html
+++ b/layouts/shortcodes/echarts.html
@@ -2,5 +2,7 @@
{{- $content := .Inner | transform.Unmarshal | jsonify -}}
{{- $id := partial "function/id.html" (dict "content" $content "scratch" $scratch) -}}
-<div class="echarts" id="{{ $id }}"></div>
+{{- $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>
{{- $scratch.Set "echarts" true -}}