mirror of
https://github.com/thegeeklab/hugo-geekblog.git
synced 2024-11-22 05:00:39 +00:00
30 lines
609 B
HTML
30 lines
609 B
HTML
{{- $ref := "" }}
|
|
{{- $class := "" }}
|
|
{{- $size := default "regular" (.Get "size" | lower) }}
|
|
|
|
{{- if not (in (slice "regular" "large") $size) }}
|
|
{{- $size = "regular" }}
|
|
{{- end }}
|
|
|
|
{{- with .Get "href" }}
|
|
{{- $ref = . }}
|
|
{{- end }}
|
|
|
|
{{- with .Get "relref" }}
|
|
{{- $ref = relref $ . }}
|
|
{{- end }}
|
|
|
|
{{- with .Get "class" }}
|
|
{{- $class = . }}
|
|
{{- end }}
|
|
|
|
|
|
<span class="gblog-button gblog-button--{{ $size }}{{ with $class }}{{ printf " %s" . }}{{ end }}">
|
|
<a
|
|
class="gblog-button__link"
|
|
{{- with $ref }}{{ printf " href=\"%s\"" . | safeHTMLAttr }}{{ end }}
|
|
>
|
|
{{ $.Inner }}
|
|
</a>
|
|
</span>
|