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> </video>
{{ else }} {{ else }}
<a href="{{ $src }}" title="{{ $title }}"> <a href="{{ $src }}" title="{{ $title }}">
{{- if eq $extension "png" -}}
<img src="{{ $src }}.jpg" alt="{{ $title }}"> <img src="{{ $src }}.jpg" alt="{{ $title }}">
{{- else -}}
<img src="{{ $src }}" alt="{{ $title }}">
{{- end -}}
</a> </a>
{{ end }} {{ end }}
{{ if $title }} {{ if $title }}

View file

@ -15,7 +15,11 @@
</video> </video>
{{ else }} {{ else }}
<a href="{{ $src }}" title="{{ $subtitle }}"> <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> </a>
{{ end }} {{ end }}
</div> </div>