Skip to content

Commit eef3f56

Browse files
committed
deal with windows slashes in feeds
1 parent b853c63 commit eef3f56

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/project/types/website/listing/website-listing-feed.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ export async function createFeed(
207207
options.type === "full",
208208
),
209209
finalFile: finalRelPath,
210-
feedLink: `${siteUrl}/${finalRelPath}`,
210+
feedLink: absoluteUrl(siteUrl, finalRelPath),
211211
};
212212
});
213213

@@ -396,7 +396,7 @@ async function renderFeed(
396396
const title = inputTarget?.outputHref
397397
? placeholder(inputTarget?.outputHref)
398398
: "";
399-
const link = `${siteUrl}${inputTarget?.outputHref}`;
399+
const link = absoluteUrl(siteUrl, inputTarget?.outputHref || "");
400400
const description = inputTarget?.outputHref
401401
? placeholder(inputTarget?.outputHref)
402402
: "";

src/project/types/website/listing/website-listing-shared.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ export const absoluteUrl = (siteUrl: string, url: string) => {
227227
? siteUrl.substring(0, siteUrl.length - 1)
228228
: siteUrl;
229229
const path = url.startsWith("/") ? url.substring(1, url.length) : url;
230-
return `${baseUrl}/${path}`;
230+
return `${baseUrl}/${path.replaceAll("\\", "/")}`;
231231
}
232232
};
233233

0 commit comments

Comments
 (0)