{"action":"created","issue":{"url":"https://api.github.com/repos/11ty/eleventy/issues/273","repository_url":"https://api.github.com/repos/11ty/eleventy","labels_url":"https://api.github.com/repos/11ty/eleventy/issues/273/labels{/name}","comments_url":"https://api.github.com/repos/11ty/eleventy/issues/273/comments","events_url":"https://api.github.com/repos/11ty/eleventy/issues/273/events","html_url":"https://github.com/11ty/eleventy/issues/273","id":368820403,"node_id":"MDU6SXNzdWUzNjg4MjA0MDM=","number":273,"title":"Feature request: Template/directory data named something other than the template/directory name","user":{"login":"caramiki","id":6446911,"node_id":"MDQ6VXNlcjY0NDY5MTE=","avatar_url":"https://avatars3.githubusercontent.com/u/6446911?v=4","gravatar_id":"","url":"https://api.github.com/users/caramiki","html_url":"https://github.com/caramiki","followers_url":"https://api.github.com/users/caramiki/followers","following_url":"https://api.github.com/users/caramiki/following{/other_user}","gists_url":"https://api.github.com/users/caramiki/gists{/gist_id}","starred_url":"https://api.github.com/users/caramiki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/caramiki/subscriptions","organizations_url":"https://api.github.com/users/caramiki/orgs","repos_url":"https://api.github.com/users/caramiki/repos","events_url":"https://api.github.com/users/caramiki/events{/privacy}","received_events_url":"https://api.github.com/users/caramiki/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-10-10T19:36:51Z","updated_at":"2018-10-11T17:08:14Z","closed_at":null,"author_association":"NONE","body":"Currently we can have template/directory specific data by naming it after the template or directory.\r\n\r\nAccording to the docs, as of v0.5.4, this is the data hierarchy, using posts as an example (just copy/pasting it here for reference):\r\n\r\n> 1. Content Template Front Matter Data\r\n>     - merged with any Layout Front Matter Data\r\n> 1. Template Data File (data is only applied to posts/subdir/my-first-blog-post.md)\r\n>     - posts/subdir/my-first-blog-post.11tydata.js\r\n>     - posts/subdir/my-first-blog-post.11tydata.json\r\n>     - posts/subdir/my-first-blog-post.json\r\n> 1. Directory Data File (data applies to all templates in posts/subdir/*)\r\n>     - posts/subdir/subdir.11tydata.js\r\n>     - posts/subdir/subdir.11tydata.json\r\n>     - posts/subdir/subdir.json\r\n> 1. Parent Directory Data File (data applies to all templates in posts/**/*, including subdirectories)\r\n>     - posts/posts.11tydata.js\r\n>     - posts/posts.11tydata.json\r\n>     - posts/posts.json\r\n> 1. Global Data Files in _data/* (available to all templates)\r\n\r\nUsing the posts example, I would like the option to have files named `posts/*.11tydata.js`, `posts/*.11tydata.json`, and/or `posts/*.json` and have the data in those files available to that template/directory.\r\n\r\nCurrently I'm using the global data to solve my problem since it allows wildcard matching with file names, but this isn't ideal because I don't need this data available in all my templates. Also I don't like the route of having one file named `posts/posts.json` for my case because I have a lot of data and I like keeping it in separate files for organizational purposes."},"comment":{"url":"https://api.github.com/repos/11ty/eleventy/issues/comments/429038849","html_url":"https://github.com/11ty/eleventy/issues/273#issuecomment-429038849","issue_url":"https://api.github.com/repos/11ty/eleventy/issues/273","id":429038849,"node_id":"MDEyOklzc3VlQ29tbWVudDQyOTAzODg0OQ==","user":{"login":"zachleat","id":39355,"node_id":"MDQ6VXNlcjM5MzU1","avatar_url":"https://avatars2.githubusercontent.com/u/39355?v=4","gravatar_id":"","url":"https://api.github.com/users/zachleat","html_url":"https://github.com/zachleat","followers_url":"https://api.github.com/users/zachleat/followers","following_url":"https://api.github.com/users/zachleat/following{/other_user}","gists_url":"https://api.github.com/users/zachleat/gists{/gist_id}","starred_url":"https://api.github.com/users/zachleat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zachleat/subscriptions","organizations_url":"https://api.github.com/users/zachleat/orgs","repos_url":"https://api.github.com/users/zachleat/repos","events_url":"https://api.github.com/users/zachleat/events{/privacy}","received_events_url":"https://api.github.com/users/zachleat/received_events","type":"User","site_admin":false},"created_at":"2018-10-11T17:08:14Z","updated_at":"2018-10-11T17:08:14Z","author_association":"COLLABORATOR","body":"Hm, I think I understand but can you walk me through an example of what you’re thinking?\r\n\r\nSo you have `posts/my-post-1.md` and `posts/my-post-2.md` and you want both of those to use a custom directory data file named something other than `posts/posts.json`?\r\n\r\nWhy not use `posts/my-post-1.json` and `posts/my-post-2.json` (or similar .11tydata.* files)?"}}
{"actor":{"display_login":"zachleat"}}