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:
@@ -86,9 +86,10 @@ jobs:
|
|||||||
AUTHOR_AVATAR: ${{ secrets.AUTHOR_AVATAR }}
|
AUTHOR_AVATAR: ${{ secrets.AUTHOR_AVATAR }}
|
||||||
AUTHOR_BIO: ${{ secrets.AUTHOR_BIO }}
|
AUTHOR_BIO: ${{ secrets.AUTHOR_BIO }}
|
||||||
AUTHOR_EMAIL: ${{ secrets.AUTHOR_EMAIL }}
|
AUTHOR_EMAIL: ${{ secrets.AUTHOR_EMAIL }}
|
||||||
GITHUB_USERNAME: ${{ secrets.GH_USERNAME }}
|
GITHUB_USERNAME: ${{ secrets.GITHUB_USERNAME }}
|
||||||
MASTODON_INSTANCE: ${{ secrets.MASTODON_INSTANCE }}
|
MASTODON_INSTANCE: ${{ secrets.MASTODON_INSTANCE }}
|
||||||
MASTODON_USER: ${{ secrets.MASTODON_USER }}
|
MASTODON_USER: ${{ secrets.MASTODON_USER }}
|
||||||
|
BLUESKY_HANDLE: ${{ secrets.BLUESKY_HANDLE }}
|
||||||
OWNYOURSWARM_FEED_URL: ${{ secrets.OWNYOURSWARM_FEED_URL }}
|
OWNYOURSWARM_FEED_URL: ${{ secrets.OWNYOURSWARM_FEED_URL }}
|
||||||
OWNYOURSWARM_FEED_TOKEN: ${{ secrets.OWNYOURSWARM_FEED_TOKEN }}
|
OWNYOURSWARM_FEED_TOKEN: ${{ secrets.OWNYOURSWARM_FEED_TOKEN }}
|
||||||
LISTENING_FETCH_CACHE_DURATION: ${{ secrets.LISTENING_FETCH_CACHE_DURATION }}
|
LISTENING_FETCH_CACHE_DURATION: ${{ secrets.LISTENING_FETCH_CACHE_DURATION }}
|
||||||
|
|||||||
+17
-2
@@ -6,8 +6,23 @@
|
|||||||
import EleventyFetch from "@11ty/eleventy-fetch";
|
import EleventyFetch from "@11ty/eleventy-fetch";
|
||||||
|
|
||||||
export default async function () {
|
export default async function () {
|
||||||
const instance = process.env.MASTODON_INSTANCE?.replace("https://", "") || "";
|
const instance = (
|
||||||
const username = process.env.MASTODON_USER || "";
|
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 {
|
try {
|
||||||
// First, look up the account ID
|
// First, look up the account ID
|
||||||
|
|||||||
@@ -6,8 +6,23 @@
|
|||||||
import EleventyFetch from "@11ty/eleventy-fetch";
|
import EleventyFetch from "@11ty/eleventy-fetch";
|
||||||
|
|
||||||
export default async function () {
|
export default async function () {
|
||||||
const instance = process.env.MASTODON_INSTANCE?.replace("https://", "") || "";
|
const instance = (
|
||||||
const username = process.env.MASTODON_USER || "";
|
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 {
|
try {
|
||||||
// First, look up the account ID
|
// First, look up the account ID
|
||||||
|
|||||||
Reference in New Issue
Block a user