Support featured videos (instead of image)

This commit is contained in:
BBaoVanC 2021-10-08 22:52:58 -05:00
parent 346ef21784
commit 2616803f47
Signed by: bbaovanc
GPG Key ID: 18089E4E3CCF1D3A
3 changed files with 15 additions and 3 deletions

View File

@ -21,7 +21,7 @@
margin-top: 10px;
}
.post-image {
.post-media {
margin-top: 15px;
}
@ -91,7 +91,7 @@ body {
max-width: 720px;
}
img {
img, video {
max-width: 100%;
}

View File

@ -69,9 +69,17 @@
{{ end }}
{{ with .Resources.GetMatch "feature" }}
<div class="post-image">
<div class="post-media">
<img src="{{ .Permalink }}" alt="{{ .Title }}" />
</div>
{{ else }}
{{ with .Resources.GetMatch "feature-video" }}
<div class="post-media">
<video controls>
<source src="{{ .Permalink }}" alt="{{ .Title }}">
</video>
</div>
{{ end }}
{{ end }}
<div class="post-description">

View File

@ -0,0 +1,4 @@
<video controls>
<source src="{{ .Get "src" }}" alt="{{ .Get "title" }}">
Your browser does not support video.
</video>