{{- $settings := partial "func/getFontAwesomeSettings.html" (dict "style" .style "arg1" .arg1 "arg2" .arg2) -}} {{- $fname:=print "/assets/svg/" .style "/" .icon ".svg" -}} {{- if (fileExists $fname) -}} {{- $svg := readFile $fname -}} {{- $svg = replace $svg " 512\">" "" $svg -}} {{- if eq .style "duotone" -}} {{- $svg = replace $svg "class=\"fa-primary\"" (print "class=\"fa-primary\" style=\"fill:" $settings.primaryColor "; opacity:" $settings.primaryOpacity "\"") -}} {{- $svg = replace $svg "class=\"fa-secondary\"" (print "class=\"fa-secondary\" style=\"fill:" $settings.secondaryColor "; opacity:" $settings.secondaryOpacity "\"") -}} {{- $svg = replace $svg "" "" -}} {{- else -}} {{- $svg = replace $svg " {{- warnf "Could not find \"%s\" icon with \"%s\" style." .icon .style -}} {{- end -}} {{- "" -}}