Skip to content

Commit

Permalink
fix: broken width and height values (#36)
Browse files Browse the repository at this point in the history
  • Loading branch information
razonyang committed Jan 13, 2024
1 parent 73b64e5 commit e3bc1b6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions layouts/partials/images/picture.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
{{- $attrs = $attrs | append `loading="lazy"` }}
{{- end }}
{{- with .naturalHeight }}
{{- $attrs = $attrs | append (printf `height="%d"` .) }}
{{- $attrs = $attrs | append (printf `height="%s"` (string .)) }}
{{- end }}
{{- with .naturalWidth }}
{{- $attrs = $attrs | append (printf `width="%d"` .) }}
{{- $attrs = $attrs | append (printf `width="%s"` (string .)) }}
{{- end }}
{{- with .style }}
{{- $attrs = $attrs | append (printf `style="%s"` (delimit . `; `)) }}
Expand All @@ -24,10 +24,10 @@
{{- $attrs = $attrs | append (printf `data-src="%s"` .) }}
{{- end }}
{{- with .originalWidth }}
{{- $attrs = $attrs | append (printf `data-width="%d"` .) }}
{{- $attrs = $attrs | append (printf `data-width="%s"` (string .)) }}
{{- end }}
{{- with .originalHeight }}
{{- $attrs = $attrs | append (printf `data-height="%d"` .) }}
{{- $attrs = $attrs | append (printf `data-height="%s"` (string .)) }}
{{- end }}
{{- end }}
<img {{ delimit $attrs " " | safeHTMLAttr }} />
Expand Down

0 comments on commit e3bc1b6

Please sign in to comment.