Skip to content

Commit

Permalink
🔀 Merge pull request #427 from kpavlov/patch-1
Browse files Browse the repository at this point in the history
🐛 Fix render-image.html for SVG
  • Loading branch information
jpanther authored Jan 9, 2023
2 parents 3bd6da3 + 5e8d30c commit efe48e0
Showing 1 changed file with 18 additions and 10 deletions.
28 changes: 18 additions & 10 deletions layouts/_default/_markup/render-image.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,24 @@
{{ end }}
{{ with $resource }}
<figure>
<img
class="my-0 rounded-md"
srcset="
{{ (.Resize "330x").RelPermalink }} 330w,
{{ (.Resize "660x").RelPermalink }} 660w,
{{ (.Resize "1024x").RelPermalink }} 1024w,
{{ (.Resize "1320x").RelPermalink }} 2x"
src="{{ (.Resize "660x").RelPermalink }}"
alt="{{ $altText }}"
/>
{{ if eq .MediaType.SubType "svg" }}
<img
class="my-0 rounded-md"
src="{{ .RelPermalink }}"
alt="{{ $altText }}"
/>
{{ else }}
<img
class="my-0 rounded-md"
srcset="
{{ (.Resize "330x").RelPermalink }} 330w,
{{ (.Resize "660x").RelPermalink }} 660w,
{{ (.Resize "1024x").RelPermalink }} 1024w,
{{ (.Resize "1320x").RelPermalink }} 2x"
src="{{ (.Resize "660x").RelPermalink }}"
alt="{{ $altText }}"
/>
{{ end }}
{{ with $caption }}<figcaption>{{ . | markdownify }}</figcaption>{{ end }}
</figure>
{{ else }}
Expand Down

0 comments on commit efe48e0

Please sign in to comment.