uci-hugo-doc/layouts/shortcodes/button.html

28 lines
575 B
HTML
Raw Normal View History

2020-01-12 06:33:02 -08:00
{{ $ref := "" }}
{{ $target := "" }}
{{ $size := default "regular" (.Get "size" | lower) }}
{{ if not (in (slice "regular" "large") $size) }}
{{ $size = "regular" }}
{{ end }}
2020-01-12 06:33:02 -08:00
{{ with .Get "href" }}
{{ $ref = . }}
{{ $target = "_blank" }}
2020-01-12 06:33:02 -08:00
{{ end }}
{{ with .Get "relref" }}
{{ $ref = relref $ . }}
2020-01-12 06:33:02 -08:00
{{ end }}
<span class="gdoc-button gdoc-button--{{ $size }}{{ with .Get "class" }}{{ . }}{{ end }}">
<a
{{ with $ref }}href="{{ . }}"{{ end }}
{{ with $target }}target="{{ . }}"{{ end }}
class="gdoc-button__link"
>
{{ $.Inner }}
</a>
2020-02-04 15:41:13 -08:00
</span>