-
-
Notifications
You must be signed in to change notification settings - Fork 493
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
Better error messaging for permalinks with missing trailing slash #3399
Comments
Is it worth documenting? Maybe in Working with Templates > Permalinks > Use template syntax in Permalink or Advanced Usage?
The example in Dynamic permalinks for a directory of content templates does not have a trailing slash, but maybe that doesn’t matter because it is in a Directory Data File? |
Certainly a +1 for an error message or documentation regarding this (Maybe there is documentation now? but I didn't know what was wrong in order to seek it out); I missed a trailing slash in my pagination of tags setup (Following this guide: https://www.11ty.dev/docs/quicktips/tag-pages/) and without it the Image plugin transform wouldn't work on these generated pages. I spent a while trying to figure out the problem because everything else on the page was seemingly working ok, like the name of the tag itself and the data was coming through. I feel mighty silly for having missed a single "/", but some kind of error message would have helped narrow it down quicker :) |
Eleventy v3.0.0-alpha.21 and v3.0.0-beta.2 will now ship with an error message when templates with a truthy
Now, this isn’t always an error for every project so you can disable this new error message globally with |
The error message looks like this: [11ty] Problem writing Eleventy templates:
[11ty] The template at './index.html' attempted to write to './_site/foo' (via `permalink` value: 'foo'), which is a target on the file system that does not include a file extension.
[11ty]
[11ty] You *probably* want to add a `.html` file extension to your permalink, so that most hosts will know how to correctly serve this file to web browsers. Without a file extension, this file may not be reliably deployed without additional hosting configuration (it won’t have a mime type) and may also cause local development issues if you later attempt to write to a subdirectory of the same name.
[11ty]
[11ty] Learn more: https://www.zachleat.com/web/trailing-slash/
[11ty]
[11ty] This is usually but not *always* an error so if you’d like to disable this error message, use `eleventyConfig.configureErrorReporting({ allowMissingExtensions: true });` |
Added support for |
Temporary docs preview deploying to https://11ty-website-git-v3-11ty.vercel.app/docs/permalinks/#trailing-slashes |
Could we also add |
@groenroos done! |
This comes up fairly often, most recently at #3379.
The text was updated successfully, but these errors were encountered: