my website at ewancroft.uk
6
fork

Configure Feed

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

fix(posts): fix the Leaflet post URI directing

+18 -6
+6 -2
src/lib/services/atproto/posts.ts
··· 158 158 if (PUBLIC_LEAFLET_BASE_PATH) { 159 159 url = `${PUBLIC_LEAFLET_BASE_PATH}/${rkey}`; 160 160 } else if (publication?.basePath) { 161 - url = `${publication.basePath}/${rkey}`; 161 + // Ensure basePath is a complete URL 162 + const basePath = publication.basePath.startsWith('http') 163 + ? publication.basePath 164 + : `https://${publication.basePath}`; 165 + url = `${basePath}/${rkey}`; 162 166 } else if (publicationRkey) { 163 167 url = `https://leaflet.pub/lish/${PUBLIC_ATPROTO_DID}/${publicationRkey}/${rkey}`; 164 168 } else { ··· 473 477 console.error(`[fetchPostFromUri] Failed to fetch post at depth ${depth}:`, err); 474 478 return null; 475 479 } 476 - } 480 + }
+6 -2
src/routes/blog/[rkey]/+server.ts
··· 102 102 if (PUBLIC_LEAFLET_BASE_PATH) { 103 103 url = `${PUBLIC_LEAFLET_BASE_PATH}/${rkey}`; 104 104 } else if (publication?.basePath) { 105 - url = `${publication.basePath}/${rkey}`; 105 + // Ensure basePath is a complete URL 106 + const basePath = publication.basePath.startsWith('http') 107 + ? publication.basePath 108 + : `https://${publication.basePath}`; 109 + url = `${basePath}/${rkey}`; 106 110 } else if (publicationRkey) { 107 111 url = `https://leaflet.pub/lish/${PUBLIC_ATPROTO_DID}/${publicationRkey}/${rkey}`; 108 112 } else { ··· 184 188 'Cache-Control': 'public, max-age=31536000, immutable' 185 189 } 186 190 }); 187 - }; 191 + };
+6 -2
src/routes/blog/rss/+server.ts
··· 150 150 } 151 151 152 152 if (publication.basePath) { 153 - return `https://${publication.basePath}/rss`; 153 + // Ensure basePath is a complete URL 154 + const basePath = publication.basePath.startsWith('http') 155 + ? publication.basePath 156 + : `https://${publication.basePath}`; 157 + return `${basePath}/rss`; 154 158 } 155 159 156 160 // Fallback to Leaflet /lish format ··· 164 168 .replace(/>/g, '>') 165 169 .replace(/"/g, '"') 166 170 .replace(/'/g, '''); 167 - } 171 + }