hugo-book/layouts/shortcodes/button.html
2024-10-02 12:02:41 +02:00

13 lines
400 B
HTML

{{- $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 | .Page.RenderString }}
</a>