{{/*
Buttons. `primary` is the solid blue button with a leading arrow tile,
`ghost` the pale blue secondary with corner ticks, `text` a quiet link
with an arrow. Any trailing "→" in a label is dropped — the arrow is drawn.
*/}}
{{ range . }}
{{ $label := replaceRE `\s*[→↗]\s*$` "" .label }}
{{ $external := or (hasPrefix .url "http") (hasPrefix .url "mailto:") }}
{{ $href := cond (or $external (hasPrefix .url "#")) .url (.url | relURL) }}
{{ if eq .style "ghost" }}
{{ $label }}{{ if $external }}↗{{ else }}→{{ end }}
{{ else if eq .style "text" }}
{{ $label }}{{ if $external }}↗{{ else }}→{{ end }}
{{ else }}
{{ $label }}
{{ end }}
{{ end }}