fix button class handling (#444)
This commit is contained in:
parent
7286ce085e
commit
aa15025ba0
1 changed files with 6 additions and 4 deletions
|
@ -1,5 +1,5 @@
|
|||
{{- $ref := "" }}
|
||||
{{- $target := "" }}
|
||||
{{- $class := "" }}
|
||||
{{- $size := default "regular" (.Get "size" | lower) }}
|
||||
|
||||
{{- if not (in (slice "regular" "large") $size) }}
|
||||
|
@ -8,19 +8,21 @@
|
|||
|
||||
{{- with .Get "href" }}
|
||||
{{- $ref = . }}
|
||||
{{- $target = "_blank" }}
|
||||
{{- end }}
|
||||
|
||||
{{- with .Get "relref" }}
|
||||
{{- $ref = relref $ . }}
|
||||
{{- end }}
|
||||
|
||||
{{- with .Get "class" }}
|
||||
{{- $class = . }}
|
||||
{{- end }}
|
||||
|
||||
<span class="gdoc-button gdoc-button--{{ $size }}{{ with .Get "class" }}{{ . }}{{ end }}">
|
||||
|
||||
<span class="gdoc-button gdoc-button--{{ $size }}{{ with $class }}{{ printf " %s" . }}{{ end }}">
|
||||
<a
|
||||
class="gdoc-button__link"
|
||||
{{- with $ref }}{{ printf " href=\"%s\"" . | safeHTMLAttr }}{{ end }}
|
||||
{{- with $target }}{{ printf " target=\"%s\"" . | safeHTMLAttr }}{{ end }}
|
||||
>
|
||||
{{ $.Inner }}
|
||||
</a>
|
||||
|
|
Loading…
Reference in a new issue