hugo-geekblog/layouts/shortcodes/button.html

26 lines
496 B
HTML
Raw Normal View History

2020-07-06 18:55:32 +00:00
{{ $ref := "" }}
{{ $size := default "regular" (.Get "size" | lower) }}
{{ if not (in (slice "regular" "large") $size) }}
{{ $size = "regular" }}
{{ end }}
2020-07-06 18:55:32 +00:00
{{ with .Get "href" }}
{{ $ref = . }}
{{ end }}
{{ with .Get "relref" }}
{{ $ref = relref $ . }}
{{ end }}
2022-01-08 12:45:19 +00:00
<span
class="gblog-button gblog-button--{{ $size }}{{ with .Get "class" }}
{{ printf " %s" . }}
{{ end }}"
>
<a {{ with $ref }}href="{{ . }}"{{ end }} class="gblog-button__link">
{{ $.Inner }}
</a>
2020-07-06 18:55:32 +00:00
</span>