Skip to content

Commit

Permalink
Remove webp resize till golang support it properly
Browse files Browse the repository at this point in the history
See details in [issue][1]

[1]: golang/go#60437
  • Loading branch information
kuzaxak committed Aug 30, 2023
1 parent 1169198 commit 0ae489b
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions layouts/_default/_markup/render-image.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,19 @@
{{- if and (not $img) .Page.File -}}
{{ $path := path.Join .Page.File.Dir .Destination }}
{{- $img = resources.Get $path -}}
{{ printf "%#v" $path }}
{{- end -}}
{{- with $img -}}
{{- $large := $img.Resize "1200x" -}}
{{ $medium := $large.Fill "726x402" -}}
{{ $small := $medium.Fill "458x254" -}}
{{/* TODO restore after fix https://github.com/golang/go/issues/60437
{{- $large := $img.Resize "1200x" -}}
{{ $medium := $large.Fill "726x402" -}}
{{ $small := $medium.Fill "458x254" -}}
*/}}
<figure class="image-caption">
<img alt="{{ $.Text }}" srcset="
{{ $small.RelPermalink }} 458w,
{{ $medium.RelPermalink }} 726w,
{{ $large.RelPermalink }} 1200w"
<img alt="{{ $.Text }}"
sizes="50vw"
width="{{ $img.Width }}"
height="{{ $img.Height }}"
src="{{ $small.RelPermalink }}" />
src="{{ $img.Permalink }}" />
<figcaption>{{ with $.Title | safeHTML }}{{ . }}{{ end }}</figcaption>
</figure>
{{- else -}}
Expand Down

0 comments on commit 0ae489b

Please sign in to comment.