Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extensionless layout in 2.0 canary 20 #2704

Closed
flaviotordini opened this issue Dec 19, 2022 · 8 comments
Closed

Extensionless layout in 2.0 canary 20 #2704

flaviotordini opened this issue Dec 19, 2022 · 8 comments

Comments

@flaviotordini
Copy link

flaviotordini commented Dec 19, 2022

Operating system

macOS

Eleventy

2.0.0-canary.20

Describe the bug

I'm using liquid layout names without extension.

    eleventyConfig.setLiquidOptions({
        extname: ".liquid"
    });

Just updated to canary 20 and got this error:

[11ty] You’re trying to use a layout that does not exist: base (undefined) (via Error)
  Eleventy:EleventyErrorHandler (error stack): Error: You’re trying to use a layout that does not exist: base (undefined)
  Eleventy:EleventyErrorHandler     at TemplateLayoutPathResolver.getFullPath (/Users/.../node_modules/@11ty/eleventy/src/TemplateLayoutPathResolver.js:102:13)

Reproduction steps

No response

Expected behavior

No response

Reproduction URL

No response

Screenshots

No response

@pdehaan
Copy link
Contributor

pdehaan commented Dec 19, 2022

See #2700

@zachleat
Copy link
Member

Whew, a few more of these and I will revert the default 😅

@zachleat
Copy link
Member

@flaviotordini
Copy link
Author

Thanks! I missed that.

@reubenlillie
Copy link

reubenlillie commented Dec 19, 2022

Whew, a few more of these and I will revert the default 😅

@zachleat, I think there just needs to be a really clear notice, since it's a potentially breaking change. Maybe a clearer error message like "It looks like the layout file you specified is missing a file extension."

If memory serves, previous documentation made it sound like omitting the file extension was a preferable, nifty feature, to promote Eleventy's flexible templating language options. I agree that specifying an extension is a significant performance improvement. If there is a default that can forego specification, it should be *.11ty.js (though I'm obviously biased).

@pdehaan
Copy link
Contributor

pdehaan commented Dec 19, 2022

@zachleat What about reverting the build error and seeing if we can flag it as a noisy warning in https://github.com/11ty/eleventy-upgrade-help and possibly say we'll change the default behavior in 2.1 or 3.0.

Not sure if we need to add that eleventy-upgrade-help plugin to the https://www.11ty.dev/docs/ sidebar to increase visibility (since I knew about it, but still took some googling to find it).

@zachleat
Copy link
Member

Restoring this in #2708! This is more popular than I thought 😅

@zachleat zachleat added this to the Eleventy 2.0.0 milestone Dec 21, 2022
@paulshryock
Copy link
Contributor

I do like the change to require the extension, and I agree that a more clear error message explaining that the file extension is missing would make it easier. I mean that's the point of a canary/alpha release is that there will be API-breaking changes as the design is iterated on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants