Xin 3ec2e18870 hugo init
chore: add .gitignore

feat: add hugo configs

chore: initialize npm

feat: add hugo tailwind starter site

chore: add basic taskfile

chore: add README.md

feat: add 404 template

chore: add .prettierrc

chore: update hugo.toml

feat: add icons and icon.html partial
2023-08-16 20:38:01 +01:00

14 lines
306 B
HTML

{{- $icon := index .context.Site.Data.icons .name -}}
{{- if not $icon -}}
{{ errorf "icon %q not found" .name }}
{{- end -}}
{{- $icon = $icon | safeHTML -}}
{{- if .attributes -}}
{{- $icon = replaceRE "<svg" (printf "<svg %s" .attributes) $icon -}}
{{- end -}}
{{- return ($icon | safeHTML) -}}