mirror of https://github.com/onweru/compose.git

weru
10.13.2020 f5d63ff4a4dc4e66786236533234d862b9055b73
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
{{- $link := .Get 0 -}}
{{- $label := .Get 1 }}
{{- $icon := .Get 2 }}
{{- $modifier := "" }}
{{- if in $label "translucent" }}
  {{ $modifier = "translucent" }}
{{- end }}
{{- if in $label "," }}
  {{- $details := split $label "," }}
  {{- $label = index $details 0 }}
  {{- $modifier = printf "button_%s" (trim (index $details 1) " ") }}
{{- end -}}
<a href="{{ $link }}" class="button {{ $modifier }}">
  {{- with $icon -}}
  <img src="/images/{{ . }}" alt="icon">
  {{- end }}
  {{- $label -}}
</a>