From 125e8b85435c5f25614bca0c436b7882d8dc993e Mon Sep 17 00:00:00 2001 From: Bretton <36870434+BrettM86@users.noreply.github.com> Date: Thu, 16 Jul 2026 00:23:56 -0700 Subject: [PATCH] fix(community): use the canonical slug form in community links Community meta rows and headers linked to /c/c- while post permalinks used /c/, giving every community two URLs. Strip the c- prefix in communityIdentifier like postLink already does. Co-Authored-By: Claude Fable 5 --- src/lib/feature/community/helpers.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/lib/feature/community/helpers.ts b/src/lib/feature/community/helpers.ts index 0801503d..0324f9f1 100644 --- a/src/lib/feature/community/helpers.ts +++ b/src/lib/feature/community/helpers.ts @@ -1,16 +1,18 @@ import type { CommunityRef, CommunityView } from '$lib/api/coves/types' +import { communitySlug } from '$lib/app/util.svelte' /** * Returns the identifier string for a community (for URLs, route params, etc.). - * Prefers `handle`, falling back to `did` — both are accepted by the - * `[handle=handle]` route matcher, whereas a bare `name` (e.g. "general") + * Prefers the canonical slug form of `handle` (no `c-` prefix, matching + * {@link postLink} permalinks), falling back to `did` — both are accepted by + * the `[handle=handle]` route matcher, whereas a bare `name` (e.g. "general") * would build a URL the router refuses. For human-readable text use * {@link communityHandleOrName} or {@link communityDisplayName} instead. */ export function communityIdentifier( community: CommunityView | CommunityRef, ): string { - return community.handle ?? community.did + return community.handle ? communitySlug(community.handle) : community.did } /** -- 2.51.2