fix(route/bsky): render video thumbnail (#17345)
This commit is contained in:
@@ -62,8 +62,8 @@ async function handler(ctx) {
|
||||
description: art(path.join(__dirname, 'templates/post.art'), {
|
||||
text: post.record.text.replaceAll('\n', '<br>'),
|
||||
embed: post.embed,
|
||||
// embed.$type "app.bsky.embed.record#view" and "app.bsky.embed.recordWithMedia#view"
|
||||
// are not handled
|
||||
// embed.$type "app.bsky.embed.record#view" and "app.bsky.embed.recordWithMedia#view" are not handled
|
||||
// "app.bsky.embed.video#view" is rendered as image
|
||||
}),
|
||||
author: post.author.displayName,
|
||||
pubDate: parseDate(post.record.createdAt),
|
||||
|
||||
@@ -3,11 +3,13 @@
|
||||
{{ /if }}
|
||||
|
||||
{{ if embed }}
|
||||
{{ if embed.$type == 'app.bsky.embed.images#view'}}
|
||||
{{ if embed.$type === 'app.bsky.embed.images#view' }}
|
||||
{{ each embed.images i }}
|
||||
<img src="{{ i.fullsize }}" alt="{{ i.alt }}"><br>
|
||||
{{ /each }}
|
||||
{{ else if embed.$type == 'app.bsky.embed.external#view' }}
|
||||
{{ else if embed.$type === 'app.bsky.embed.video#view' }}
|
||||
<img src="{{ embed.thumbnail }}"><br>
|
||||
{{ else if embed.$type === 'app.bsky.embed.external#view' }}
|
||||
<a href="{{ embed.external.uri }}"><b>{{ embed.external.title }}</b><br>
|
||||
{{ embed.external.description }}
|
||||
</a>
|
||||
|
||||
Reference in New Issue
Block a user