Skip to content

Commit

Permalink
extends blocks to all blocks in a post and reblog trail
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkSuckerberg committed Aug 7, 2024
1 parent 1bc1fd7 commit 9178095
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,13 @@ async function mainPage(
originalPost: TumblrBlocksPost | undefined,
url: URL
) {
const blocks = originalPost ? originalPost.content.concat(post.content) : post.content;
const trail = post.trail as TumblrBlocksPost[];

const blocks = post.content.concat(
trail.flatMap(trailPost => {
return trailPost.content;
})
);

const twitterCard =
blocks.find(element => element.type == 'image' || element.type == 'video')?.type == 'video'
Expand Down

0 comments on commit 9178095

Please sign in to comment.