2022-05-22 20:00:37 +00:00
|
|
|
{{- $name := .Get "name" -}}
|
2022-11-02 12:01:20 +00:00
|
|
|
{{- $sort := .Get "sort" -}}
|
|
|
|
{{- $order := default "asc" (.Get "order") -}}
|
2022-05-22 20:00:37 +00:00
|
|
|
|
|
|
|
{{- if .Site.Data.properties }}
|
|
|
|
<dl class="gdoc-props">
|
2022-05-26 15:07:38 +00:00
|
|
|
{{- with (index .Site.Data.properties (split $name ".")) }}
|
2022-11-02 12:01:20 +00:00
|
|
|
{{- $properties := .properties }}
|
|
|
|
{{- with $sort }}
|
|
|
|
{{- $properties = (sort $properties . $order) }}
|
|
|
|
{{- end }}
|
|
|
|
{{- range $properties }}
|
2022-05-22 20:00:37 +00:00
|
|
|
<dt class="flex flex-wrap align-center gdoc-props__meta">
|
2022-11-02 12:01:20 +00:00
|
|
|
<span class="gdoc-props__title">{{ .name }}</span>
|
|
|
|
{{- if .required }}
|
2022-05-22 20:00:37 +00:00
|
|
|
<span class="gdoc-props__tag warning">{{ i18n "propertylist_required" | lower }}</span>
|
|
|
|
{{ else }}
|
|
|
|
<span class="gdoc-props__tag tip">{{ i18n "propertylist_optional" | lower }}</span>
|
|
|
|
{{- end }}
|
2022-11-02 12:01:20 +00:00
|
|
|
{{- with .type }}
|
2022-05-22 20:00:37 +00:00
|
|
|
<span class="gdoc-props__tag note">{{ . }}</span>
|
|
|
|
{{- end }}
|
|
|
|
|
2022-11-02 12:01:20 +00:00
|
|
|
{{- with .tags }}
|
2022-05-22 20:00:37 +00:00
|
|
|
{{- $tags := . }}
|
|
|
|
{{- if reflect.IsMap $tags }}
|
|
|
|
{{- $tags = (index $tags $.Site.Language.Lang) }}
|
|
|
|
{{- end }}
|
|
|
|
{{- range $tags }}
|
|
|
|
<span class="gdoc-props__tag">{{ . }}</span>
|
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|
|
|
|
</dt>
|
|
|
|
<dd>
|
2022-05-30 19:40:09 +00:00
|
|
|
<div class="gdoc-props__description">
|
2022-11-02 12:01:20 +00:00
|
|
|
{{- with .description }}
|
2022-05-22 20:00:37 +00:00
|
|
|
{{- $desc := . }}
|
|
|
|
{{- if reflect.IsMap $desc }}
|
|
|
|
{{- $desc = (index $desc $.Site.Language.Lang) }}
|
|
|
|
{{- end }}
|
|
|
|
|
2022-05-30 19:40:09 +00:00
|
|
|
{{ $desc | $.Page.RenderString }}
|
2022-05-22 20:00:37 +00:00
|
|
|
{{ end }}
|
|
|
|
</div>
|
|
|
|
<div class="gdoc-props__default">
|
2022-11-02 12:01:20 +00:00
|
|
|
{{- with default "none" (.defaultValue | string) }}
|
2022-05-22 20:00:37 +00:00
|
|
|
<span>{{ i18n "propertylist_default" | title }}:</span>
|
|
|
|
<span>{{ . }}</span>
|
|
|
|
{{- end }}
|
|
|
|
</div>
|
|
|
|
</dd>
|
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|
|
|
|
</dl>
|
|
|
|
{{- end }}
|