kaneo (minimalist kanban) fork to experiment adding a tangled integration github.com/usekaneo/kaneo
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

at cd7cada2f86b4e866a15b4323bb8d6d7ab5bba8b 19 lines 521 B view raw
1import { normalizeGiteaBaseUrl } from "../config"; 2 3export function baseUrlFromRepositoryHtmlUrl(htmlUrl: string): string { 4 try { 5 const u = new URL(htmlUrl); 6 const segments = u.pathname.split("/").filter(Boolean); 7 if (segments.length < 2) { 8 return ""; 9 } 10 11 const basePathSegments = segments.slice(0, -2); 12 const basePath = 13 basePathSegments.length > 0 ? `/${basePathSegments.join("/")}` : ""; 14 15 return normalizeGiteaBaseUrl(`${u.origin}${basePath}`); 16 } catch { 17 return ""; 18 } 19}