From 491be28cce5caacbfbc4d05082507504c47ad3b5 Mon Sep 17 00:00:00 2001 From: "Calvin A. Allen" Date: Thu, 8 Jan 2026 16:56:42 -0500 Subject: [PATCH 1/3] fix(giscus): add CORS header for custom theme CSS Also show bluesky engagement sections with 0 counts instead of hiding them --- public/_headers | 2 ++ src/components/BlueskyEngagement.astro | 14 +++----------- 2 files changed, 5 insertions(+), 11 deletions(-) create mode 100644 public/_headers 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..f164ca8 100644 --- a/src/components/BlueskyEngagement.astro +++ b/src/components/BlueskyEngagement.astro @@ -129,17 +129,9 @@ 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'); - } - - // Hide reposters section if no reposts - const repostersSection = container.querySelector('.reposters-section'); - if (reposts === 0 && repostersSection) { - repostersSection.classList.add('hidden'); - } + // Note: We always show the sections even with 0 counts + // The count displays "0 likes from" / "0 reposts from" + // Avatars area remains empty when there are no likers/reposters // Update Bluesky link if (blueskyLink) { From e29d09a555c468e7eecd4bb0dd264d068cf9012a Mon Sep 17 00:00:00 2001 From: "Calvin A. Allen" Date: Thu, 8 Jan 2026 16:59:36 -0500 Subject: [PATCH 2/3] feat(bluesky): add sad face placeholder when no engagement --- src/components/BlueskyEngagement.astro | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/src/components/BlueskyEngagement.astro b/src/components/BlueskyEngagement.astro index f164ca8..a44aeea 100644 --- a/src/components/BlueskyEngagement.astro +++ b/src/components/BlueskyEngagement.astro @@ -129,9 +129,24 @@ const handle = "codingwithcalvin.net"; if (likesLabel) likesLabel.textContent = likes === 1 ? 'like from' : 'likes from'; if (repostsLabel) repostsLabel.textContent = reposts === 1 ? 'repost from' : 'reposts from'; - // Note: We always show the sections even with 0 counts - // The count displays "0 likes from" / "0 reposts from" - // Avatars area remains empty when there are no likers/reposters + // Show sad face when no engagement + const sadFaceHtml = `
+ + + + + + +
`; + + if (likes === 0 && likersAvatars) { + likersAvatars.innerHTML = sadFaceHtml; + } + + const repostersAvatars = container.querySelector('.reposters-avatars'); + if (reposts === 0 && repostersAvatars) { + repostersAvatars.innerHTML = sadFaceHtml; + } // Update Bluesky link if (blueskyLink) { @@ -179,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` From a5439947f3fd795e941946f0b8440a3b4ead0732 Mon Sep 17 00:00:00 2001 From: "Calvin A. Allen" Date: Thu, 8 Jan 2026 17:01:13 -0500 Subject: [PATCH 3/3] feat(rss): add blueskyPostId to RSS feed items --- src/pages/rss.xml.ts | 8 ++++++++ 1 file changed, 8 insertions(+) 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`, }); }