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 }}
|
||||
|
||||
{{ with index . "src" }}
|
||||
{{ $media := . }}
|
||||
{{ 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" }}
|
||||
<video controls preload="metadata">
|
||||
<source src="{{ $media.Permalink }}" alt="{{ $media.Title }}">
|
||||
<source src="{{ .Permalink }}" alt="{{ .Title }}">
|
||||
{{ i18n "browser_no_video_support" }}
|
||||
</video>
|
||||
{{ end }}
|
||||
|
||||
{{ if not $hidecaption }}
|
||||
{{ with $media.Title }}
|
||||
{{ with .Title }}
|
||||
<figcaption>
|
||||
{{ . | markdownify }}
|
||||
</figcaption>
|
||||
|
Reference in New Issue
Block a user