mirror of
https://github.com/thegeeklab/hugo-geekdoc.git
synced 2024-11-04 20:30:40 +00:00
23 lines
552 B
HTML
23 lines
552 B
HTML
{{ $ref := "" }}
|
|
{{ $target := "" }}
|
|
{{ $size := default "regular" (.Get "size" | lower) }}
|
|
|
|
{{ if not (in (slice "regular" "large") $size) }}
|
|
{{ $size = "regular" }}
|
|
{{ end }}
|
|
|
|
{{ with .Get "href" }}
|
|
{{ $ref = . }}
|
|
{{ $target = "_blank" }}
|
|
{{ end }}
|
|
|
|
{{ with .Get "relref" }}
|
|
{{ $ref = relref $ . }}
|
|
{{ 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>
|
|
</span>
|