Skip to content

Commit 491be28

Browse files
committed
fix(giscus): add CORS header for custom theme CSS
Also show bluesky engagement sections with 0 counts instead of hiding them
1 parent b6769a0 commit 491be28

2 files changed

Lines changed: 5 additions & 11 deletions

File tree

public/_headers

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/giscus-theme.css
2+
Access-Control-Allow-Origin: https://giscus.app

src/components/BlueskyEngagement.astro

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -129,17 +129,9 @@ const handle = "codingwithcalvin.net";
129129
if (likesLabel) likesLabel.textContent = likes === 1 ? 'like from' : 'likes from';
130130
if (repostsLabel) repostsLabel.textContent = reposts === 1 ? 'repost from' : 'reposts from';
131131

132-
// Hide likers section if no likes
133-
const likersSection = container.querySelector('.likers-section');
134-
if (likes === 0 && likersSection) {
135-
likersSection.classList.add('hidden');
136-
}
137-
138-
// Hide reposters section if no reposts
139-
const repostersSection = container.querySelector('.reposters-section');
140-
if (reposts === 0 && repostersSection) {
141-
repostersSection.classList.add('hidden');
142-
}
132+
// Note: We always show the sections even with 0 counts
133+
// The count displays "0 likes from" / "0 reposts from"
134+
// Avatars area remains empty when there are no likers/reposters
143135

144136
// Update Bluesky link
145137
if (blueskyLink) {

0 commit comments

Comments
 (0)