From b6ce753ae7892839899962b879e2cc5808c60732 Mon Sep 17 00:00:00 2001 From: Dillon Date: Sat, 21 Mar 2020 20:52:12 +0800 Subject: =?UTF-8?q?feat(shortcodes):=20add=20width=20and=20height=20params?= =?UTF-8?q?=20for=20echarts=20shortc=E2=80=A6=20(#192)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- layouts/shortcodes/echarts.html | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'layouts') 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) -}} -
+{{- $width := cond .IsNamedParams (.Get "width") (.Get 0) | default "100%" -}} +{{- $height := cond .IsNamedParams (.Get "height") (.Get 1) | default "30rem" -}} +
{{- $scratch.Set "echarts" true -}} -- cgit v1.2.3