hackertours/layouts/_partials/fa-icon.html
Stefan Bethke 01054e1419
Some checks failed
/ build (pull_request) Successful in 43s
/ accessibility (pull_request) Has been cancelled
Turn calendar download link into an icon, vendor font awesome for that.
2026-10-17 02:07:04 +02:00

10 lines
557 B
HTML

{{- /*
A Font Awesome icon as inline SVG, decorative (hidden from screen readers) and drawn in the
current text colour. Param: the icon as "style/name", e.g. "regular/calendar-plus"; the files
are in assets/vendor/fontawesome/. The SVG keeps its attribution comment (CC BY 4.0).
*/ -}}
{{- with resources.Get (printf "vendor/fontawesome/%s.svg" .) -}}
{{- replace .Content "<svg " `<svg class="fa-icon" aria-hidden="true" focusable="false" ` 1 | safeHTML -}}
{{- else -}}
{{- errorf "fa-icon: no icon %q in assets/vendor/fontawesome/" . -}}
{{- end -}}