Skip to content

Commit 69dcac5

Browse files
committed
Within feeds, remove index.html
Fixes #6904
1 parent db30371 commit 69dcac5

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

‎news/changelog-1.4.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@
8282
- ([#6706](https://github.com/quarto-dev/quarto-cli/issues/6706)): If there is no text displayed for external links in navigation items (navbar, sidebar), display the href value as the text.
8383
- ([#6903](https://github.com/quarto-dev/quarto-cli/issues/6903)): Don't display the `path` field for external paths provided in metadata files.
8484
- ([#5463](https://github.com/quarto-dev/quarto-cli/issues/5463)): Error if the `contents` of a listing match no items.
85+
- ([#6904](https://github.com/quarto-dev/quarto-cli/issues/6904)): Within feeds, remove `index.html` from urls which shouldn't include it.
8586

8687
## Websites
8788

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,12 @@ export const absoluteUrl = (siteUrl: string, url: string) => {
289289
const baseUrl = siteUrl.endsWith("/")
290290
? siteUrl.substring(0, siteUrl.length - 1)
291291
: siteUrl;
292-
const path = url.startsWith("/") ? url.substring(1, url.length) : url;
292+
let path = url.startsWith("/") ? url.substring(1, url.length) : url;
293+
if (path.endsWith("/index.html")) {
294+
path = join(dirname(path), "/");
295+
} else if (path === "index.html") {
296+
path = "";
297+
}
293298
return `${baseUrl}/${path.replaceAll("\\", "/")}`;
294299
}
295300
};

0 commit comments

Comments
 (0)