refactor(partials): extract to native renderer

This commit is contained in:
kdevo
2021-10-09 16:04:49 +02:00
parent 621d0bc7c6
commit 8121a2f2e1
2 changed files with 15 additions and 9 deletions
+9
View File
@@ -0,0 +1,9 @@
{{ $class := .class }}
{{ $alt := .alt }}
{{ $imgDict := .imgDict }}
<img src="{{ $imgDict.default.Permalink }}"
class="{{ $class }}" loading="lazy"
{{- with $imgDict.default }} height="{{ .Height }}" width="{{ .Width }}" {{- end -}}
{{- if $imgDict.responsive -}} {{ with partial "renderer/_srcset" $imgDict }} srcset="{{ . }}"{{- end }} {{- end -}}
{{- with $alt }} alt="{{ . }}" {{- end }}>