diff --git a/modules/rcal/components/folk-calendar-view.ts b/modules/rcal/components/folk-calendar-view.ts index fa1eed2..bcaddd0 100644 --- a/modules/rcal/components/folk-calendar-view.ts +++ b/modules/rcal/components/folk-calendar-view.ts @@ -348,8 +348,12 @@ class FolkCalendarView extends HTMLElement { // ── API ── private getApiBase(): string { - const match = window.location.pathname.match(/^\/([^/]+)\/cal/); - return match ? `/${match[1]}/cal` : ""; + // When on the rcal page directly, extract from URL + const match = window.location.pathname.match(/^\/([^/]+)\/rcal/); + if (match) return `/${match[1]}/rcal`; + // When embedded as a canvas shape, use the space attribute + if (this.space) return `/${this.space}/rcal`; + return ""; } private async loadMonth() {