Remove trailing slash from URLs

This commit is contained in:
Zach Leatherman 2024-09-27 16:32:47 -05:00
parent ef4e52d57d
commit fb5caf353b

View File

@ -16,10 +16,15 @@ export default async function(eleventyConfig) {
}); });
eleventyConfig.addUrlTransform((page) => { eleventyConfig.addUrlTransform((page) => {
if (page.url.endsWith(".html")) { if (page.url.endsWith("/")) {
return page.url.slice(0, -1 * ".html".length); return page.url.slice(0, -1);
} }
}); });
// eleventyConfig.addUrlTransform((page) => {
// if (page.url.endsWith(".html")) {
// return page.url.slice(0, -1 * ".html".length);
// }
// });
// eleventyConfig.addGlobalData("permalink", () => { // eleventyConfig.addGlobalData("permalink", () => {
// return (data) => // return (data) =>
// `${data.page.filePathStem}.${data.page.outputFileExtension}`; // `${data.page.filePathStem}.${data.page.outputFileExtension}`;