bobatheme/layouts/partials/featured_media.html

19 lines
552 B
HTML
Raw Normal View History

<div class="post-media">
<figure>
{{ $media := . | resources.Fingerprint "sha512" }}
{{ if eq .MediaType.MainType "image" }}
<img src="{{ $media.Permalink }}" alt="{{ $media.Title }}" />
{{ else if eq .MediaType.MainType "video" }}
<video controls>
<source src="{{ $media.Permalink }}" alt="{{ $media.Title }}">
</video>
{{ end }}
{{ with $media.Title }}
<figcaption>
{{ . | markdownify }}
</figcaption>
{{ end }}
</figure>
</div>