mirror of https://github.com/jpanther/congo.git
Fix render-image.html for SVG
SVG images do not support resizing, so `srcset/src` attributes should be simplifiedpull/427/head
parent
574275d650
commit
5e8d30c305
|
@ -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 }}
|
||||
|
|
Loading…
Reference in New Issue