-
-
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
Allow top level directory specific data files #245
Comments
This repository is now using lodash style issue management for enhancements. This means enhancement issues will now be closed instead of leaving them open. The enhancement backlog can be found here: https://github.com/11ty/eleventy/issues?utf8=%E2%9C%93&q=label%3Aneeds-votes+sort%3Areactions-%2B1-desc+ Don’t forget to upvote the top comment with 👍! |
It feels like a step towards this, and stepping around the naming issue, would be to define it in the config. Otherwise, can I propose I'm familiar with the code, but would be happy to take a shot. |
Hmm! (I don’t think this is the right place for an addition to Layout aliasing, but I do just want to make sure you know that it exists: https://www.11ty.io/docs/layouts/#layout-aliasing) Also related, configuration API to set global data: #184 However, I’d prioritize this issue over those two others I just mentioned. More value here, I think. For the naming question, I was tempated to go with the existing pattern of using the parent folder name (even though, in this case, it’d be the project folder name). But when I think about it a bit more I think this pattern will cause issues—specifically with how GitHub repos are set up—if you check out a project from GitHub and don’t name the parent folder correctly the project wouldn’t build right, which is very bad. So I think you’re on the right track. Maybe |
Wow GitHub comments are out of order here—that‘s confusing. https://www.githubstatus.com/ seems all nominal though ¯_(ツ)_/¯ |
I don't the issue with the naming … What files are conflicting? |
Consider this repo: https://github.com/11ty/eleventy-base-blog My original comment was proposing that we tie into However, if someone checks the repo out, there is no guarantee as to what they’ve named the parent folder (as it is not enforced by the git project structure). They could have cloned into anything. We shouldn’t couple this or enforce constraints that introduce variability based on where you’ve cloned the project. So, a standard |
Ah, okay, I think, I see what the issue now. Now, I want to have the files deployed on So we can't rely on What we would need is a pendant to My personal take: This is something, a So you could defer to packages like |
I'm inclined to echo @Ryuno-Ki's concerns about using a hidden file for defaults. I wonder if it's a personal preference, but I've never been keen on configuration being in hidden files (but that's the standard-ish devworld we have). But adding defaults into a hidden file bears some careful consideration. I think there's a strong pro for using the same convention of I get why there's a period - to avoid any potential conflicts with user authored code. Though a counter argument in favour of what @zachleat is saying: if the hashtag name is hard… |
Linux History: How Dot Files Became Hidden Files - in case you are interested why we have hidden files in the first place :-) |
I would do it like this:
I never realized this when working with Eleventy, but the |
@zachleat I'd love to see this happen; would you accept a PR? |
Some work for this is happening in #935 although I am arguing that that one is a bug and this one is a enhancement 😇 |
Global data files allow scoped global data to be set, but how do I set a permalink structure for the entire project?
_data/myGlobal.js
scopes tomyGlobal.*
I want to set a
permalink
structure in./myProject.11tydata.js
that cascades to all templates.One wrinkle could be what the file name convention would be (or if this matters at all).
If my project parent directory is
myProject
then we could look in./myProject.11tydata.js
,./myProject.11tydata.json
, and maybe./myProject.js
(probably not this one, too much potential for conflicts?)Related: https://www.11ty.io/docs/data-template-dir/
The text was updated successfully, but these errors were encountered: