-
-
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
set*Directory Configuration API methods #1503
Comments
Completely agree with this and a +1 from me. |
are shipping with 3.0.0-alpha.6. These methods will throw an error if you attempt to use them in plugins. These are project-space features only for now! |
dir
Having a few second thoughts about this API, hmm. Consider this, where the order matters (not ideal): export default function(eleventyConfig) {
eleventyConfig.directories.input; // WARN has "./"
eleventyConfig.addPlugin(eleventyConfig => {
eleventyConfig.directories.input; // has "./content/"
});
eleventyConfig.setInputDirectory("content");
eleventyConfig.directories.input; // has "./content/"
}; I’m kinda tempted to just move it to be an export level thing in your config file, like this: export default function(eleventyConfig) {
eleventyConfig.directories.input; // has "./content/"
};
export const config = {
dir: {
input: "content"
}
} The above would ensure consistent directory references in your project. As discussed in #3244, the hope in adding these methods would improve the current situation (and it does improve it) but if we move to a named export we would eliminate these issues entirely: export default function(eleventyConfig) {
// IMPROVED by eleventyConfig.setInputDirectory("content");
// But the API method still needs to be called first (order matters)
eleventyConfig.directories.input; // WARN has "./"
eleventyConfig.addPlugin(eleventyConfig => {
eleventyConfig.directories.input; // has "./content/"
});
return {
dir: {
input: "content",
}
}
}; |
Moved that secondary feature to #3246. Given the feedback about this one we’ll keep it around for 3.0.0-alpha.6 |
Temporary preview docs: https://11ty-website-git-v3-11ty.vercel.app/docs/config/#configuration-options |
Is your feature request related to a problem? Please describe.
There’s no a corresponding method for the
dir
configuration property.Describe the solution you'd like
Adding a
setDirectories
(or something like that) configuration method.Describe alternatives you've considered
Using the existing property.
Additional context
I’d like to only use methods for consistency.
Also see #1502 for
{data,markdown,html}TemplateEngine
.The text was updated successfully, but these errors were encountered: