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

weru
30.02.2020 20d7b580be202c69cbadb4b82f3525f183b61dfe
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>