first commit
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
{{/*
|
||||
Buttons. `primary` is the solid cyan button, `ghost` the outlined
|
||||
secondary, `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" }}
|
||||
<a href="{{ $href }}" class="btn btn-secondary">{{ $label }}<span class="arrow" aria-hidden="true">{{ if $external }}↗{{ else }}→{{ end }}</span></a>
|
||||
{{ else if eq .style "text" }}
|
||||
<a href="{{ $href }}" class="more">{{ $label }}<span class="arrow" aria-hidden="true">{{ if $external }}↗{{ else }}→{{ end }}</span></a>
|
||||
{{ else }}
|
||||
<a href="{{ $href }}" class="btn btn-primary">{{ $label }}<span class="arrow" aria-hidden="true">{{ if $external }}↗{{ else }}→{{ end }}</span></a>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
Reference in New Issue
Block a user