Skip to content

Commit

Permalink
Generate class properly for SVG
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewheberle committed Apr 29, 2024
1 parent fd0ebef commit b7954d9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions picture/partial/picture.html
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,9 @@
{{- if hugo.IsProduction }}
{{- $img = $img | minify | fingerprint }}
{{- end }}

{{/* generate class attr */}}
{{- $attrs = merge $attrs (dict "class" (delimit $class " ")) -}}
<img src="{{ $img.RelPermalink }}"{{ range $attr, $value := $attrs }} {{ printf "%s=%q" $attr $value | safeHTMLAttr }}{{ end }}>
{{- else }}
{{- if and (ne $img.MediaType "image/webp") $webp }}
Expand Down

0 comments on commit b7954d9

Please sign in to comment.