a tool for shared writing and social publishing

check if doc path has leading / and add if needed

+7 -3
+7 -3
app/lish/createPub/getPublicationURL.ts
··· 58 58 docUri: string, 59 59 publication?: PublicationInput | NormalizedPublication | null, 60 60 ): string { 61 - const path = doc.path || "/" + new AtUri(docUri).rkey; 61 + let path = doc.path || "/" + new AtUri(docUri).rkey; 62 + if (path[0] !== "/") path = "/" + path; 62 63 const aturi = new AtUri(docUri); 63 64 64 65 const isNormalized = 65 66 !!publication && 66 - (publication as NormalizedPublication).$type === "site.standard.publication"; 67 + (publication as NormalizedPublication).$type === 68 + "site.standard.publication"; 67 69 const normPub = isNormalized 68 70 ? (publication as NormalizedPublication) 69 71 : publication 70 72 ? normalizePublicationRecord((publication as PublicationInput).record) 71 73 : null; 72 - const pubInput = isNormalized ? null : (publication as PublicationInput | null); 74 + const pubInput = isNormalized 75 + ? null 76 + : (publication as PublicationInput | null); 73 77 74 78 // Non-leaflet documents always use the full publication site URL 75 79 if (doc.content && !hasLeafletContent(doc) && normPub?.url) {