{{/* Return the requested SVG icon */}} {{/* Search for the icon in the Hugo Blox Builder icon library, falling back to user's icon library */}} {{- $icon := index site.Data.icons .name -}} {{/* Currently, only other pack supported is `brands` icon pack in sub-folder */}} {{ $pack := .pack | default "" }} {{ $pack = cond (gt (len $pack) 0) (printf "%s/" $pack) "" }} {{ if not $icon }} {{ with resources.GetMatch (printf "media/icons/%s%s.svg" $pack .name) }} {{ $icon = .Content }} {{else}} {{ warnf "The icon `%s.svg` was not found in your `assets/media/icons/` folder" .name }} {{ end }} {{ end }} {{ if .attributes }} {{ $icon = replaceRE "