mirror of
https://github.com/BBaoVanC/bobatheme.git
synced 2025-07-04 11:07:32 -05:00
Set height and width specifically on img tag
This commit is contained in:
@ -7,18 +7,17 @@
|
|||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{ with index . "src" }}
|
{{ with index . "src" }}
|
||||||
{{ $media := . }}
|
|
||||||
{{ if eq .MediaType.MainType "image" }}
|
{{ if eq .MediaType.MainType "image" }}
|
||||||
<img src="{{ $media.Permalink }}" alt="{{ $media.Title }}" loading="lazy" />
|
<img src="{{ .Permalink }}" alt="{{ .Title }}" width="{{ .Width }}" height="{{ .Height }}" loading="lazy" />
|
||||||
{{ else if eq .MediaType.MainType "video" }}
|
{{ else if eq .MediaType.MainType "video" }}
|
||||||
<video controls preload="metadata">
|
<video controls preload="metadata">
|
||||||
<source src="{{ $media.Permalink }}" alt="{{ $media.Title }}">
|
<source src="{{ .Permalink }}" alt="{{ .Title }}">
|
||||||
{{ i18n "browser_no_video_support" }}
|
{{ i18n "browser_no_video_support" }}
|
||||||
</video>
|
</video>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{ if not $hidecaption }}
|
{{ if not $hidecaption }}
|
||||||
{{ with $media.Title }}
|
{{ with .Title }}
|
||||||
<figcaption>
|
<figcaption>
|
||||||
{{ . | markdownify }}
|
{{ . | markdownify }}
|
||||||
</figcaption>
|
</figcaption>
|
||||||
|
Reference in New Issue
Block a user