fix: social activity widget - Bluesky and Mastodon feeds not rendering

- deploy.yml: add missing BLUESKY_HANDLE env var to Build site step
- deploy.yml: fix GITHUB_USERNAME secret name (was GH_USERNAME)
- mastodonFeed.js: read MASTODON_URL first, fall back to MASTODON_INSTANCE
- mastodonFeed.js: add early-return guard when instance/user vars are empty
- mastodonFeed.js: also accept MASTODON_USERNAME as fallback for MASTODON_USER

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
svemagie
2026-03-10 01:31:19 +01:00
parent 471653331d
commit ec9887a6d7
3 changed files with 36 additions and 5 deletions

View File

@@ -6,8 +6,23 @@
import EleventyFetch from "@11ty/eleventy-fetch";
export default async function () {
const instance = process.env.MASTODON_INSTANCE?.replace("https://", "") || "";
const username = process.env.MASTODON_USER || "";
const instance = (
process.env.MASTODON_URL ||
process.env.MASTODON_INSTANCE ||
""
)
.replace(/^https?:\/\//, "")
.replace(/\/+$/, "");
const username = (
process.env.MASTODON_USER ||
process.env.MASTODON_USERNAME ||
""
).trim().replace(/^@+/, "");
if (!instance || !username) {
console.log("[mastodonFeed] MASTODON_URL/MASTODON_USER not set, skipping");
return [];
}
try {
// First, look up the account ID