hugo-geekdoc/layouts/shortcodes/button.html

30 lines
606 B
HTML
Raw Normal View History

{{- $ref := "" }}
2022-06-27 07:14:24 +00:00
{{- $class := "" }}
{{- $size := default "regular" (.Get "size" | lower) }}
{{- if not (in (slice "regular" "large") $size) }}
{{- $size = "regular" }}
{{- end }}
2020-01-12 14:33:02 +00:00
{{- with .Get "href" }}
{{- $ref = . }}
{{- end }}
2020-01-12 14:33:02 +00:00
{{- with .Get "relref" }}
{{- $ref = relref $ . }}
{{- end }}
2020-01-12 14:33:02 +00:00
2022-06-27 07:14:24 +00:00
{{- with .Get "class" }}
{{- $class = . }}
{{- end }}
2022-06-27 07:14:24 +00:00
<span class="gdoc-button gdoc-button--{{ $size }}{{ with $class }}{{ printf " %s" . }}{{ end }}">
<a
class="gdoc-button__link"
{{- with $ref }}{{ printf " href=\"%s\"" . | safeHTMLAttr }}{{ end }}
>
{{ $.Inner }}
</a>
2020-02-04 23:41:13 +00:00
</span>