parent
ea4c2dc200
commit
fba2bd8805
8 changed files with 9 additions and 9 deletions
@ -1,5 +1,5 @@ |
|||||||
{{- $img := resources.Get .path }} |
{{- $img := resources.Get .path }} |
||||||
{{- $img = $img.Resize (printf "%dx%d webp" $img.Width $img.Height) }} |
{{- $img = $img.Resize (printf "%dx%d webp" $img.Width $img.Height) }} |
||||||
<img src="{{ $img.Permalink }}" alt="{{ .alt | default " " }}" width="{{ .width | default $img.Width }}" |
<img src="{{ $img.Permalink }}" alt="{{ .alt | default "" }}" width="{{ .width | default $img.Width }}" |
||||||
height="{{ .height | default $img.Height }}" {{- if .class}}class="{{ .class }}" {{end}} |
height="{{ .height | default $img.Height }}" {{- if .class}}class="{{ .class }}" {{end}} |
||||||
{{- if .style}}style="{{ .style | safeCSS | default " " }}" {{end}} /> |
{{- if .style}}style="{{ .style | safeCSS }}" {{end}} /> |
@ -1,3 +1,3 @@ |
|||||||
{{- if .Get "src" }} |
{{- if .Get "src" }} |
||||||
{{- partial "image.html" (dict "path" (.Get "src") "alt" (.Get "alt" | plainify | default " ") "style" (.Get "style" | safeCSS | default " ") )}} |
{{- partial "image.html" (dict "path" (.Get "src") "alt" (.Get "alt" | plainify) "style" (.Get "style" | safeCSS) )}} |
||||||
{{- end }} |
{{- end }} |
Loading…
Reference in new issue