Skip to content

Commit

Permalink
Do not attempt to resize SVGs
Browse files Browse the repository at this point in the history
  • Loading branch information
ElanHasson committed Sep 13, 2022
1 parent dad9ef0 commit 6015b1e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions layouts/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,15 @@
{{- $featured := $images.GetMatch "*feature*" -}}
{{- if not $featured }}{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}{{ end -}}
{{- with $featured -}}
{{- if eq .MediaType.SubType "svg" -}}
{{- $smallImg = $featured.Permalink -}}
{{- $largeImg = $featured.Permalink -}}
{{- else -}}
{{- $smallImage := $featured.Resize "180x" -}}
{{- $smallImg = $smallImage.Permalink -}}
{{- $largeImage := $featured.Resize "500x" -}}
{{- $largeImg = $largeImage.Permalink -}}
{{- end -}}
{{- $img = $featured.Permalink -}}
{{- end -}}
{{- end -}}
Expand Down

0 comments on commit 6015b1e

Please sign in to comment.