mirror of
https://github.com/adityatelange/hugo-PaperMod.git
synced 2025-01-26 04:13:12 -05:00
Refactor 5
This commit is contained in:
parent
7295940a76
commit
86b5018dfe
@ -28,15 +28,19 @@
|
||||
|
||||
{{- if $cover -}}{{/* i.e it is present in page bundle */}}
|
||||
{{- if (and (in $processableFormats $cover.MediaType.SubType) ($responsiveImages) (eq $prod true)) }}
|
||||
<img loading="{{$loading}}" srcset="{{- range $size := $sizes -}}
|
||||
{{- if (ge $cover.Width $size) -}}
|
||||
{{ printf "%s %s" (($cover.Resize (printf "%sx" $size)).Permalink) (printf "%sw ," $size) -}}
|
||||
{{ end }}
|
||||
{{- end -}}{{$cover.Permalink }} {{printf "%dw" ($cover.Width)}}"
|
||||
sizes="(min-width: 768px) 720px, 100vw" src="{{ $cover.Permalink }}"
|
||||
width="{{ $cover.Width }}" height="{{ $cover.Height }}" alt="{{ $alt }}">
|
||||
<img loading="{{$loading}}"
|
||||
srcset='{{- range $size := $sizes -}}
|
||||
{{- if (ge $cover.Width $size) }}
|
||||
{{- printf "%s %s" (($cover.Resize (printf "%sx" $size)).Permalink) (printf "%sw," $size) }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- printf "%s %dw" ($cover.Permalink) ($cover.Width) }}'
|
||||
src="{{ $cover.Permalink }}"
|
||||
sizes="(min-width: 768px) 720px, 100vw"
|
||||
width="{{ $cover.Width }}" height="{{ $cover.Height }}"
|
||||
alt="{{ $alt }}">
|
||||
{{- else }}{{/* Unprocessable image or responsive images disabled */}}
|
||||
<img loading="{{ $loading }}" src="{{ $imgdl }}" alt="{{ $alt }}">
|
||||
<img loading="{{ $loading }}" src="{{ $imgdl }}" alt="{{ $alt }}">
|
||||
{{- end }}
|
||||
{{- else }}{{/* For absolute urls and external links, no img processing here */}}
|
||||
<img loading="{{ $loading }}" src="{{ $imgdl }}" alt="{{ $alt }}">
|
||||
|
Loading…
x
Reference in New Issue
Block a user