REMOVE content and assets FIX image render
This commit is contained in:
parent
62f343ef90
commit
e385e4ee4d
10 changed files with 26 additions and 91 deletions
|
@ -23,31 +23,33 @@ caption: string
|
|||
{{ $dir := path.Dir $url }}
|
||||
{{ $mediaWidthControl := "(min-width: 1240px) 50px, 70vw" }}
|
||||
|
||||
<picture>
|
||||
{{- if eq hugo.Environment "development" }}
|
||||
<img class="{{ .type }}" width="{{ $width }}" height="{{ $height }}" src="{{ $url }}" alt="{{ .alt }}" loading="lazy"
|
||||
decoding="async">
|
||||
{{ else }}
|
||||
<source type="image/avif" srcset="
|
||||
<a href="{{ $url }}">
|
||||
<picture>
|
||||
{{- if eq hugo.Environment "development" }}
|
||||
<img class="{{ .type }}" width="{{ $width }}" height="{{ $height }}" src="{{ $url }}" alt="{{ .alt }}"
|
||||
loading="lazy" decoding="async">
|
||||
{{ else }}
|
||||
<source type="image/avif" srcset="
|
||||
{{ range $i, $size := $sizes }}
|
||||
{{ $dir }}/{{ $name }}-{{ $size }}{{ $ext }}.avif {{ $size }}w,
|
||||
{{ end }}
|
||||
{{ $url }}.avif {{ $width }}w
|
||||
" sizes="{{ $mediaWidthControl }}" />
|
||||
<source type="image/webp" srcset="
|
||||
<source type="image/webp" srcset="
|
||||
{{ range $i, $size := $sizes }}
|
||||
{{ $dir }}/{{ $name }}-{{ $size }}{{ $ext }}.webp {{ $size }}w,
|
||||
{{ end }}
|
||||
{{ $url }}.webp {{ $width }}w
|
||||
" sizes="{{ $mediaWidthControl }}" />
|
||||
<img class="{{ .type }}" width="{{ $width }}" height="{{ $height }}" srcset="
|
||||
<img class="{{ .type }}" width="{{ $width }}" height="{{ $height }}" srcset="
|
||||
{{ range $i, $size := $sizes }}
|
||||
{{ $dir }}/{{ $name }}-{{ $size }}{{ $ext }} {{ $size }}w,
|
||||
{{ end }}
|
||||
{{ $url }} {{ $width }}w
|
||||
" src="{{ $url }}" alt="{{ .alt }}" loading="lazy" decoding="async">
|
||||
{{ end }}
|
||||
</picture>
|
||||
{{ end }}
|
||||
</picture>
|
||||
</a>
|
||||
{{ if .caption }}
|
||||
<p class="caption">{{ .caption }}</p>
|
||||
{{ end }}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue