[READ-ONLY] Mirror of https://github.com/flo-bit/blog-template. minimalistic astro blog template flo-bit.dev/blog-template/
astro blog template
0

Configure Feed

Select the types of activity you want to include in your feed.

fix build

+17 -20
+1 -5
src/components/bluesky/BlueskyLikes.astro
··· 2 2 import { SITE, BASE, BLUESKY_IDENTIFIER } from "../../config.json"; 3 3 import { getCollection } from "astro:content"; 4 4 import { getLikes } from "./utils"; 5 - import { cn } from "src/utils"; 6 5 import Likes from "./Likes.svelte"; 7 6 8 7 let posts = await getCollection("posts"); 9 - 10 - console.log(posts.map((post) => post.data.record.embed?.external?.uri)); 11 8 12 9 const path = Astro.url.pathname; 13 10 ··· 21 18 new Date(a.data.indexedAt).getTime() - 22 19 new Date(b.data.indexedAt).getTime() 23 20 ) 21 + // @ts-expect-error: weird type fuckery 24 22 .find((post) => post.data.record.embed?.external?.uri === url); 25 23 26 24 let likesData = post ? await getLikes(post.data.uri) : []; 27 - 28 - console.log(likesData); 29 25 --- 30 26 31 27 <Likes
+16 -15
src/components/bluesky/Likes.svelte
··· 15 15 16 16 const url = window.location.href; 17 17 18 + // @ts-expect-error: weird type fuckery 18 19 const post = posts.find((post) => post.post.embed?.external?.uri === url); 19 20 20 21 if (post) { ··· 46 47 47 48 <div class="isolate flex -space-x-2 overflow-hidden px-4 flex-wrap"> 48 49 {#each postLikesData as user, index} 49 - <a 50 - href={`https://bsky.app/profile/${user.actor.handle}`} 51 - class={cn( 52 - "relative inline-block size-12 rounded-full overflow-hidden ring-2 ring-base-900 bg-base-950", 53 - index === 0 ? "-ml-2" : "" 54 - )} 55 - target="_blank" 56 - > 57 - <img 58 - title={user.actor.handle} 59 - loading="lazy" 60 - src={user.actor.avatar} 61 - alt={"liked by " + user.actor.handle} 62 - /> 63 - </a> 50 + <a 51 + href={`https://bsky.app/profile/${user.actor.handle}`} 52 + class={cn( 53 + "relative inline-block size-12 rounded-full overflow-hidden ring-2 ring-base-900 bg-base-950", 54 + index === 0 ? "-ml-2" : "" 55 + )} 56 + target="_blank" 57 + > 58 + <img 59 + title={user.actor.handle} 60 + loading="lazy" 61 + src={user.actor.avatar} 62 + alt={"liked by " + user.actor.handle} 63 + /> 64 + </a> 64 65 {/each} 65 66 66 67 {#if postLikesData.length < postLikesCount}