webpage/themes/hugo-book/layouts/shortcodes/button.html

13 lines
381 B
HTML
Raw Permalink Normal View History

2024-11-26 22:25:09 +00:00
{{- $ref := "" }}
{{- $target := "" -}}
{{- with .Get "href" -}}
{{- $ref = . -}}
{{- $target = "_blank" -}}
{{- end -}}
{{- with .Get "relref" -}}
{{- $ref = relref $ . -}}
{{- end -}}
<a {{ with $ref }} href="{{.}}" {{ end }} {{ with $target }} target="{{.}}" rel="noopener" {{ end }} class="book-btn{{ with .Get "class" }} {{ . }}{{ end }}">
{{- .InnerDeindent -}}
</a>