Skip to content

Commit

Permalink
Cleanup for #3399
Browse files Browse the repository at this point in the history
  • Loading branch information
zachleat committed Oct 1, 2024
1 parent 6fe3645 commit eade9a7
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/TemplateMap.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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 =
Expand Down

0 comments on commit eade9a7

Please sign in to comment.