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