Skip to content

Commit

Permalink
If the first image is a video, make it playable
Browse files Browse the repository at this point in the history
  • Loading branch information
thekid committed Jan 4, 2025
1 parent ff0ffdc commit 77138f3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/main/handlebars/feed.handlebars
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,13 @@
<a class="images is-preview" href="{{route this}}">
{{#with images.0}}
<div class="image">
<img alt="{{title}}, {{date meta.dateTime format='d.m.Y H:i'}}" {{#unless @first}}loading="lazy"{{/unless}} {{&dataset meta}} src="/image/{{slug}}/thumb-{{name}}.webp" width="1024">
{{#if is.video}}
<video controls playsinline preload="metadata" width="100%" poster="/image/{{slug}}/thumb-{{name}}.webp">
<source src="/image/{{slug}}/video-{{name}}.mp4" type="video/mp4">
</video>
{{else}}
<img alt="{{title}}, {{date meta.dateTime format='d.m.Y H:i'}}" {{#unless first}}loading="lazy"{{/unless}} {{&dataset meta}} src="/image/{{slug}}/thumb-{{name}}.webp" width="1024">
{{/if}}
</div>
{{/with}}
<div class="more">
Expand Down

0 comments on commit 77138f3

Please sign in to comment.