diff --git a/public/_headers b/public/_headers new file mode 100644 index 0000000..41c20b8 --- /dev/null +++ b/public/_headers @@ -0,0 +1,2 @@ +/giscus-theme.css + Access-Control-Allow-Origin: https://giscus.app diff --git a/src/components/BlueskyEngagement.astro b/src/components/BlueskyEngagement.astro index c12e00e..a44aeea 100644 --- a/src/components/BlueskyEngagement.astro +++ b/src/components/BlueskyEngagement.astro @@ -129,16 +129,23 @@ const handle = "codingwithcalvin.net"; if (likesLabel) likesLabel.textContent = likes === 1 ? 'like from' : 'likes from'; if (repostsLabel) repostsLabel.textContent = reposts === 1 ? 'repost from' : 'reposts from'; - // Hide likers section if no likes - const likersSection = container.querySelector('.likers-section'); - if (likes === 0 && likersSection) { - likersSection.classList.add('hidden'); + // Show sad face when no engagement + const sadFaceHtml = `
+ + + + + + +
`; + + if (likes === 0 && likersAvatars) { + likersAvatars.innerHTML = sadFaceHtml; } - // Hide reposters section if no reposts - const repostersSection = container.querySelector('.reposters-section'); - if (reposts === 0 && repostersSection) { - repostersSection.classList.add('hidden'); + const repostersAvatars = container.querySelector('.reposters-avatars'); + if (reposts === 0 && repostersAvatars) { + repostersAvatars.innerHTML = sadFaceHtml; } // Update Bluesky link @@ -187,7 +194,6 @@ const handle = "codingwithcalvin.net"; } // Fetch reposters for avatars (limit to 50) - const repostersAvatars = container.querySelector('.reposters-avatars'); if (reposts > 0 && repostersAvatars) { const repostsRes = await fetch( `https://public.api.bsky.app/xrpc/app.bsky.feed.getRepostedBy?uri=${encodeURIComponent(atUri)}&limit=50` diff --git a/src/pages/rss.xml.ts b/src/pages/rss.xml.ts index 78a2f42..8fccbf6 100644 --- a/src/pages/rss.xml.ts +++ b/src/pages/rss.xml.ts @@ -50,8 +50,16 @@ export async function GET(context: APIContext) { }; } + // Add custom data for bluesky post ID if present + if (post.data.blueskyPostId) { + item.customData = `${post.data.blueskyPostId}`; + } + return item; }), + xmlns: { + bluesky: 'https://bsky.app/ns', + }, customData: `en-us`, }); }