···
1
1
---
2
2
-
import { SITE, BASE, BLUESKY_IDENTIFIER } from "../../config.json";
2
2
+
import { BLUESKY_IDENTIFIER } from "../../config.json";
3
3
import { getCollection } from "astro:content";
4
4
import { getLikes } from "./utils";
5
5
import Likes from "./Likes.svelte";
6
6
7
7
let posts = await getCollection("posts");
8
8
9
9
-
const path = Astro.url.pathname;
9
9
+
const canonicalURL = new URL(Astro.url.pathname, Astro.site);
10
10
11
11
-
const url = SITE + path;
11
11
+
const url = canonicalURL.toString();
12
12
13
13
// get first post (sorted by indexedAt) with url in embed.external.uri
14
14
const post = posts
···
26
26
<Likes
27
27
uri={post?.data.uri}
28
28
likesData={likesData}
29
29
-
likesCount={post?.data.likeCount}
29
29
+
likesCount={Math.max(post?.data.likeCount ?? 0, likesData.length)}
30
30
user={BLUESKY_IDENTIFIER}
31
31
client:idle
32
32
/>
···
13
13
if (!uri && user) {
14
14
let posts = await getUserPosts(user);
15
15
16
16
-
const url = "https://flo-bit.dev/blog-template/posts/likes-via-bluesky/";//window.location.href;
16
16
+
const url = window.location.href;
17
17
18
18
// @ts-expect-error: weird type fuckery
19
19
const post = posts.find((post) => post.post.embed?.external?.uri === url);
···
58
58
<img
59
59
title={user.actor.handle}
60
60
loading="lazy"
61
61
-
src={user.actor.avatar}
62
62
-
alt={"liked by " + user.actor.handle}
61
61
+
src={user.actor.avatar.replace('avatar', 'avatar_thumbnail')}
62
62
+
alt={"liked by " + user.actor.displayName}
63
63
/>
64
64
</a>
65
65
{/each}
···
10
10
"ACCENT_COLOR": "amber",
11
11
"SOCIAL_LINKS": {
12
12
"FACEBOOK_URL": "",
13
13
-
"TWITTER_URL": "https://x.com/flobit_dev",
13
13
+
"TWITTER_URL": "",
14
14
"GITHUB_URL": "https://github.com/flo-bit",
15
15
-
"INSTAGRAM_URL": "https://www.instagram.com/flobit.dev/",
15
15
+
"INSTAGRAM_URL": "",
16
16
"LINKEDIN_URL": "",
17
17
"YOUTUBE_URL": "",
18
18
-
"SUBSTACK_URL": "https://flo-bit.substack.com",
18
18
+
"SUBSTACK_URL": "",
19
19
"EMAIL": "flo.bit.dev@gmail.com",
20
20
"BLUESKY_URL": "https://bsky.app/profile/flo-bit.dev"
21
21
},