Skip to content

Commit

Permalink
fix: change the check order for image resource
Browse files Browse the repository at this point in the history
  • Loading branch information
tomowang committed May 25, 2024
1 parent 3b8659a commit 6aeb747
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions layouts/_default/_markup/render-image.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@

<div class="not-prose">
<!-- check if it exists as a page resource -->
{{- with and (ne (.Page.Resources.Get $dest).MediaType.SubType "svg") (.Page.Resources.Get $dest) -}}
{{- $src := . -}}
{{- if and (.Page.Resources.Get $dest) (ne (.Page.Resources.Get $dest).MediaType.SubType "svg") -}}
{{- $src := .Page.Resources.Get $dest -}}
{{- $dataSzes := "(min-width: 1024px) 100vw, 50vw" -}}
{{- $actualImg := $src.Resize (print "640x jpg " $filter) -}}
<picture>
Expand Down

0 comments on commit 6aeb747

Please sign in to comment.