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-08-31 21:27:11 +00:00
|
|
|
<dt class="flex flex-wrap align-center gdoc-props__meta"{{ if $showAnchor }} id="{{ anchorize .name }}"{{ 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 }}
|
|
|
|
<a data-clipboard-text="{{ .Page.Permalink }}#{{ anchorize .name | safeHTML }}" class="gdoc-page__anchor clip flex align-center" title="{{ i18n "title_anchor_prefix" }} {{ .name | safeHTML }}" aria-label="{{ i18n "title_anchor_prefix" }} {{ .name | safeHTML }}" href="#{{ anchorize .name | safeHTML }}">
|
|
|
|
<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 }}
|