Files
bobatheme/layouts/_partials/icon_code.html
BBaoVanC 1aa2f8ea5c Move template files based on Hugo v0.146 revamp
See https://gohugo.io/templates/new-templatesystem-overview/

Under layouts/
- mv _default/* .
- mv partials _partials
- mv shortcodes _shortcodes
- mv taxonomy/list.html taxonomy.html
- mv taxonomy/term.html term.html
2025-06-28 03:07:02 -05:00

7 lines
338 B
HTML

{{- $icon_resource := resources.Get (printf "jam/icons/%s.svg" .) -}}
{{- $icon := $icon_resource.Content -}}
{{- $icon = replaceRE `<svg` `<svg class="icon"` $icon -}}
{{- $icon = replaceRE `</svg>` (printf `<title>%s icon</title></svg>` .) $icon -}}
{{- $icon = replaceRE `(width|height)="[0-9]*"` "" $icon -}}
{{- $icon | safeHTML -}}