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