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") -}}
|
2023-08-31 21:27:11 +00:00
|
|
|
{{- $showAnchor := (and (default true .Page.Params.geekdocAnchor) (default true .Page.Site.Params.geekdocAnchor)) -}}
|
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 }}
|
2023-10-28 20:48:31 +00:00
|
|
|
{{- $uniqueAnchor := anchorize (printf "%s-%s" $name .name) | safeHTML }}
|
|
|
|
<dt class="flex flex-wrap align-center gdoc-props__meta"{{ if $showAnchor }} id="{{ $uniqueAnchor }}"{{ end }}>
|
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>
|
2023-08-31 21:27:11 +00:00
|
|
|
{{- else }}
|
2022-05-22 20:00:37 +00:00
|
|
|
<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 }}
|
2023-08-31 21:27:11 +00:00
|
|
|
{{- if $showAnchor }}
|
2023-10-28 20:48:31 +00:00
|
|
|
<a data-clipboard-text="{{ .Page.Permalink }}#{{ $uniqueAnchor }}" class="gdoc-page__anchor clip flex align-center" title="{{ i18n "title_anchor_prefix" }} {{ .name | safeHTML }}" aria-label="{{ i18n "title_anchor_prefix" }} {{ .name | safeHTML }}" href="#{{ $uniqueAnchor }}">
|
2023-08-31 21:27:11 +00:00
|
|
|
<svg class="gdoc-icon gdoc_link"><use xlink:href="#gdoc_link"></use></svg>
|
|
|
|
</a>
|
|
|
|
{{- end }}
|
2022-05-22 20:00:37 +00:00
|
|
|
</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 }}
|
2023-08-31 21:27:11 +00:00
|
|
|
{{- end }}
|
2022-05-22 20:00:37 +00:00
|
|
|
</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 }}
|