From 99af5be92ff440d7bcd13993c6c320c724c82055 Mon Sep 17 00:00:00 2001 From: Huang Chen-Yi Date: Fri, 10 Jan 2025 02:14:37 +0800 Subject: [PATCH] chore(external docs): render array of object type in component docs (#22138) * Try to render array of object in component docs * Add some margin between rendering config-object in array block * Add some margin on top of config object and decrease the margin in array example * Remove array's `syntax` rendering since it's not defined in schema * conditional render syntax field for array type --- website/layouts/partials/data.html | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/website/layouts/partials/data.html b/website/layouts/partials/data.html index 26f4232ce720f..41268850ad469 100644 --- a/website/layouts/partials/data.html +++ b/website/layouts/partials/data.html @@ -131,10 +131,18 @@ {{ partial "badge.html" (dict "word" $k "color" "gray") }} + {{ if $v.syntax }} {{ partial "badge.html" (dict "word" $v.syntax "color" "gray") }} + {{ end }} + {{ if eq $k "object" }} +
+ {{ template "config-object" (dict "name" $name "config" $v "level" 4) }} +
+ {{ end }} + {{ with $v.examples }} {{ template "config-array-examples" (dict "examples" .) }} {{ end }} @@ -1630,7 +1638,7 @@

{{ define "config-array-examples" }} {{ $json := .examples | jsonify (dict "indent" " ") }} -
+
Examples