Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions public/_headers
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/giscus-theme.css
Access-Control-Allow-Origin: https://giscus.app
24 changes: 15 additions & 9 deletions src/components/BlueskyEngagement.astro
Original file line number Diff line number Diff line change
Expand Up @@ -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 = `<div class="flex items-center justify-center w-12 h-12 text-text-muted">
<svg class="w-10 h-10" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<circle cx="12" cy="12" r="10" stroke-width="1.5"/>
<circle cx="9" cy="9" r="1" fill="currentColor"/>
<circle cx="15" cy="9" r="1" fill="currentColor"/>
<path stroke-linecap="round" stroke-width="1.5" d="M8 16c1.333-1 2.667-1.5 4-1.5s2.667.5 4 1.5"/>
</svg>
</div>`;

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
Expand Down Expand Up @@ -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`
Expand Down
8 changes: 8 additions & 0 deletions src/pages/rss.xml.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = `<bluesky:postId>${post.data.blueskyPostId}</bluesky:postId>`;
}

return item;
}),
xmlns: {
bluesky: 'https://bsky.app/ns',
},
customData: `<language>en-us</language>`,
});
}