hugo-geekblog/layouts/shortcodes/button.html

18 lines
389 B
HTML
Raw Normal View History

2020-07-06 18:55:32 +00:00
{{ $ref := "" }}
{{ $target := "" }}
{{ with .Get "href" }}
{{ $ref = . }}
{{ $target = "_blank" }}
{{ end }}
{{ with .Get "relref" }}
{{ $ref = relref $ . }}
{{ end }}
<span class="gblog-button{{ with .Get "class" }} {{ . }}{{ end }}">
<a {{ with $ref }} href="{{.}}" {{ end }} {{ with $target }} target="{{.}}" {{ end }} class="gblog-button__link">
{{ $.Inner }}
</a>
</span>