feat: add sizes 'regular' and 'large' to button shortcode (#135)
This commit is contained in:
parent
cc10b9d80a
commit
021eaf7ab6
5 changed files with 32 additions and 5 deletions
|
@ -1,5 +1,10 @@
|
|||
{{ $ref := "" }}
|
||||
{{ $target := "" }}
|
||||
{{ $size := default "regular" (.Get "size" | lower) }}
|
||||
|
||||
{{ if not (in (slice "regular" "large") $size) }}
|
||||
{{ $size = "regular" }}
|
||||
{{ end }}
|
||||
|
||||
{{ with .Get "href" }}
|
||||
{{ $ref = . }}
|
||||
|
@ -10,7 +15,7 @@
|
|||
{{ $ref = relref $ . }}
|
||||
{{ end }}
|
||||
|
||||
<span class="gdoc-button{{ with .Get "class" }} {{ . }}{{ 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>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue