From eade9a769753e442acad0192cb8c1e7a680790f9 Mon Sep 17 00:00:00 2001 From: Zach Leatherman Date: Tue, 1 Oct 2024 08:34:34 -0500 Subject: [PATCH] Cleanup for #3399 --- src/TemplateMap.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/TemplateMap.js b/src/TemplateMap.js index 539905cf0..6b87a31cb 100644 --- a/src/TemplateMap.js +++ b/src/TemplateMap.js @@ -15,6 +15,12 @@ const debugDev = debugUtil("Dev:Eleventy:TemplateMap"); class TemplateMapConfigError extends EleventyBaseError {} class EleventyDataSchemaError extends EleventyBaseError {} +// These template URL filenames are allowed to exclude file extensions +const EXTENSIONLESS_URL_ALLOWLIST = [ + "/_redirects", // Netlify specific + "/.htaccess", // Apache +]; + class TemplateMap { constructor(eleventyConfig) { if (!eleventyConfig) { @@ -737,16 +743,10 @@ ${permalinks[page.outputPath] if ( page.outputPath === false || page.url === false || - page.data.eleventyAllowMissingExtension + page.data.eleventyAllowMissingExtension || + EXTENSIONLESS_URL_ALLOWLIST.some((url) => page.url.endsWith(url)) ) { // do nothing (also serverless) - } else if ( - [ - "/_redirects", // Netlify specific - "/.htaccess", // Apache - ].some((url) => page.url.endsWith(url)) - ) { - // do nothing } else { if (TemplatePath.getExtension(page.outputPath) === "") { let e =