mirror of
https://github.com/BBaoVanC/bobatheme.git
synced 2025-06-27 07:37:29 -05:00
Use <figure> for images and videos
This commit is contained in:
18
layouts/shortcodes/figvideo.html
Normal file
18
layouts/shortcodes/figvideo.html
Normal file
@ -0,0 +1,18 @@
|
||||
<figure>
|
||||
|
||||
{{ $vid := $.Page.Resources.GetMatch (.Get "src") | resources.Fingerprint "sha512" }}
|
||||
|
||||
{{ if .Get "href" }}<a href="{{ .Get "href" }}">{{ end }}
|
||||
<video controls>
|
||||
<source src="{{ $vid.Permalink }}" alt="{{ $vid.Title }}">
|
||||
{{ i18n "browser_no_video_support" }}
|
||||
</video>
|
||||
{{ if .Get "href" }}</a>{{ end }}
|
||||
|
||||
{{ with $vid.Title }}
|
||||
<figcaption>
|
||||
{{ . | markdownify }}
|
||||
</figcaption>
|
||||
{{ end }}
|
||||
|
||||
</figure>
|
Reference in New Issue
Block a user