diff --git a/src/data/communities.yml b/src/data/communities.yml --- a/src/data/communities.yml +++ b/src/data/communities.yml @@ -21,8 +21,6 @@ location: Colorado, US description: Colorado ATProtocol user group bluesky: https://bsky.app/profile/colorado.atprotocol.space - extraEventAccounts: - - pyxorium.com - name: ATProto Brazil handle: atproto.com.br diff --git a/src/lib/events.ts b/src/lib/events.ts --- a/src/lib/events.ts +++ b/src/lib/events.ts @@ -237,9 +237,18 @@ } } - // Filter to upcoming events and sort by date + // Filter to upcoming events, deduplicate, and sort by date const now = new Date(); - return allEvents + const upcoming = allEvents .filter(e => new Date(e.date) >= now) .sort((a, b) => new Date(a.date).getTime() - new Date(b.date).getTime()); + + // Deduplicate by name + start time (same event posted by multiple accounts) + const seen = new Set(); + return upcoming.filter(e => { + const key = `${e.name.toLowerCase().trim()}|${e.date}`; + if (seen.has(key)) return false; + seen.add(key); + return true; + }); } diff --git a/src/pages/events.astro b/src/pages/events.astro --- a/src/pages/events.astro +++ b/src/pages/events.astro @@ -12,16 +12,14 @@ name: string; handle: string; location: string; - extraEventAccounts?: string[]; } const communities = yaml.load(communitiesRaw) as Community[]; -// Build event account list: atmosphere.community + all community handles + extra accounts +// Build event account list: atmosphere.community + all community handles const eventAccounts = [ 'atmosphere.community', ...communities.map(c => c.handle), - ...communities.flatMap(c => c.extraEventAccounts ?? []), ]; // Verify core services are reachable diff --git a/src/pages/index.astro b/src/pages/index.astro --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -21,7 +21,6 @@ description?: string; bluesky?: string; website?: string; - extraEventAccounts?: string[]; } const communities = yaml.load(communitiesRaw) as Community[]; @@ -66,11 +65,10 @@ tag: post.tags?.[0], })); -// Build event account list: atmosphere.community + all community handles + extra accounts +// Build event account list: atmosphere.community + all community handles const eventAccounts = [ 'atmosphere.community', ...communities.map(c => c.handle), - ...communities.flatMap(c => c.extraEventAccounts ?? []), ]; // Fetch events from ATProto (community.lexicon.calendar.event)