hackertours-theme/layouts/_shortcodes/button.html
2025-04-11 18:31:55 +02:00

6 lines
322 B
HTML

{{ $class := .Get "class" -}}
{{ $newtab := .Get "newtab" | default false -}}
{{ $src := .Get "src" -}}
{{ $text := .Get "text" -}}
<a class="button{{ with $class }} {{ . }}{{ end }}" href="{{ $src }}"{{ if $newtab }} target="_blank" rel="noopener noreferrer"{{ end }}>{{ $text }}</a>
{{- /* chomp trailing newline */ -}}