shortcodes: do not request thumbnails if the image is jpg

This commit is contained in:
liushuyu 2021-01-12 17:10:02 -07:00
parent 68a67d2bb4
commit cd51353e9b
No known key found for this signature in database
GPG Key ID: 23D1CE4534419437
2 changed files with 9 additions and 1 deletions

View File

@ -14,7 +14,11 @@
</video>
{{ else }}
<a href="{{ $src }}" title="{{ $title }}">
{{- if eq $extension "png" -}}
<img src="{{ $src }}.jpg" alt="{{ $title }}">
{{- else -}}
<img src="{{ $src }}" alt="{{ $title }}">
{{- end -}}
</a>
{{ end }}
{{ if $title }}

View File

@ -15,7 +15,11 @@
</video>
{{ else }}
<a href="{{ $src }}" title="{{ $subtitle }}">
<img src="{{ $src }}.jpg" alt="{{ $subtitle }}">
{{- if eq $extension "png" -}}
<img src="{{ $src }}.jpg" alt="{{ $title }}">
{{- else -}}
<img src="{{ $src }}" alt="{{ $title }}">
{{- end -}}
</a>
{{ end }}
</div>