13 lines
548 B
HTML
13 lines
548 B
HTML
{{- $style := or (.Get "style") (.Get 0) "default" -}}
|
|
{{- $attributes := partial "docs/text/mapper" (dict
|
|
"attributes" (cond .IsNamedParams .Params dict)
|
|
"merge" (dict
|
|
"class" (slice "book-badge" $style)
|
|
)
|
|
) -}}
|
|
<span {{ partial "docs/html-attrs" $attributes | safeHTMLAttr }}>
|
|
{{- with or (.Get "title") (.Get 1) -}}<span class="book-badge-title">{{ . | plainify }}</span>{{- end -}}
|
|
{{- with or (.Get "value") (.Get 2) -}}<span class="book-badge-value">{{ . | plainify }}</span>{{- end -}}
|
|
</span>
|
|
{{- /* remove whitespaces */ -}}
|