Changeset 5f3f9ec in Klonkt for src/views/partials/post-tile.ejs


Ignore:
Timestamp:
06/30/2026 11:06:00 PM (2 months ago)
Author:
roboburr <roboburr@…>
Branches:
main
Children:
86fa2d2
Parents:
e091add
Message:

fix(cirkel): render a federated video cover as <video>, not a broken <img>

An animated cover that federates as an MP4 (Video attachment) put the video URL into cover_image_url
— circle.js's mediaImage fell back to media[0] even when it was the video — so the Cirkel feed
rendered <img src=...mp4> = a broken image. Now the video is extracted separately (never used as the
cover image) and post-tile/post-card render a muted looping <video> for a video-only cover.

Co-Authored-By: Claude <noreply@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/views/partials/post-tile.ejs

    re091add r5f3f9ec  
    66const _isPinned = !!post.pinned;
    77const _isBoost = !!post.isBoost;
    8 const _hasCover = !!post.cover_image_url;
     8const _hasCover = !!post.cover_image_url || !!post.cover_video_url;
    99const _typeLabel = (post.type && post.type !== 'post') ? post.type : '';
    1010const _src = post.source_name || '';   // bron-site (cirkel-feed: van welke site komt deze post)
     
    1919   <% if (_ext) { %>target="_blank" rel="noopener"<% } else { %>hx-get="<%= _href %>?partial=1" hx-target="#pcms-main" hx-swap="innerHTML" hx-push-url="<%= _href %>" hx-indicator="#pcms-loading"<% } %>>
    2020
    21   <% if (_hasCover) { %><img class="grid-tile-img" src="<%= thumb(post.cover_image_url, 480) %>" alt="" loading="lazy" decoding="async"<% if (post.cover_video_url) { %> data-ios-mp4="<%= post.cover_video_url %>"<% } %>><% } %>
     21  <% if (post.cover_image_url) { %><img class="grid-tile-img" src="<%= thumb(post.cover_image_url, 480) %>" alt="" loading="lazy" decoding="async"<% if (post.cover_video_url) { %> data-ios-mp4="<%= post.cover_video_url %>"<% } %>><% } else if (post.cover_video_url) { %><video class="grid-tile-img" src="<%= post.cover_video_url %>" autoplay loop muted playsinline></video><% } %>
    2222
    2323  <% if (_typeLabel) { %>
Note: See TracChangeset for help on using the changeset viewer.