{"action":"created","issue":{"url":"https://api.github.com/repos/MajorLeagueBaseball/fabricator-assemble/issues/3","repository_url":"https://api.github.com/repos/MajorLeagueBaseball/fabricator-assemble","labels_url":"https://api.github.com/repos/MajorLeagueBaseball/fabricator-assemble/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/MajorLeagueBaseball/fabricator-assemble/issues/3/comments","events_url":"https://api.github.com/repos/MajorLeagueBaseball/fabricator-assemble/issues/3/events","html_url":"https://github.com/MajorLeagueBaseball/fabricator-assemble/pull/3","id":151691300,"number":3,"title":"Fix material helper to allow patterns of structure materials/x/nn-y/nn-z.ext","user":{"login":"chrisnicotera","id":183303,"avatar_url":"https://avatars.githubusercontent.com/u/183303?v=3","gravatar_id":"","url":"https://api.github.com/users/chrisnicotera","html_url":"https://github.com/chrisnicotera","followers_url":"https://api.github.com/users/chrisnicotera/followers","following_url":"https://api.github.com/users/chrisnicotera/following{/other_user}","gists_url":"https://api.github.com/users/chrisnicotera/gists{/gist_id}","starred_url":"https://api.github.com/users/chrisnicotera/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrisnicotera/subscriptions","organizations_url":"https://api.github.com/users/chrisnicotera/orgs","repos_url":"https://api.github.com/users/chrisnicotera/repos","events_url":"https://api.github.com/users/chrisnicotera/events{/privacy}","received_events_url":"https://api.github.com/users/chrisnicotera/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-04-28T16:49:26Z","updated_at":"2016-04-28T16:51:40Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/MajorLeagueBaseball/fabricator-assemble/pulls/3","html_url":"https://github.com/MajorLeagueBaseball/fabricator-assemble/pull/3","diff_url":"https://github.com/MajorLeagueBaseball/fabricator-assemble/pull/3.diff","patch_url":"https://github.com/MajorLeagueBaseball/fabricator-assemble/pull/3.patch"},"body":"Assuming `options.keys.materials` is set to `materials`,\r\nWhen you have a materials directory with the following structure:\r\n\r\n```\r\n└── materials\r\n    └── non-numeric-parent\r\n        └── 00-with-a-numeric-subcategory\r\n            └── 00-and-a-numeric-material.hbs\r\n```\r\n\r\nAnd try to use the [`{{material}}`](https://github.com/fbrctr/fabricator/blob/v1.2.3/src/views/layouts/includes/f-item-content.html#L7) helper when [iterating](https://github.com/fbrctr/fabricator/blob/v1.2.3/src/views/layouts/includes/f-menu.html#L12) over `materials.non-numeric-parent.items` using `@key` to reference the name of the material you're referencing, it will resolve incorrectly.\r\n\r\n`@key` ends up being `00-with-a-numeric-subcategory.00-and-a-numeric-material`, and the [`replace`](https://github.com/fbrctr/fabricator-assemble/blob/v1.1.11/index.js#L554) only ends up replacing the first instance of the regex, leaving you with an invalid partial (in this case, `with-a-numeric-subcategory.00-and-a-numeric-material`).\r\n\r\nAdding `/g` will replace both of these instances, resulting in the correct partial name and resolution."},"comment":{"url":"https://api.github.com/repos/MajorLeagueBaseball/fabricator-assemble/issues/comments/215492258","html_url":"https://github.com/MajorLeagueBaseball/fabricator-assemble/pull/3#issuecomment-215492258","issue_url":"https://api.github.com/repos/MajorLeagueBaseball/fabricator-assemble/issues/3","id":215492258,"user":{"login":"mtsquire","id":1382236,"avatar_url":"https://avatars.githubusercontent.com/u/1382236?v=3","gravatar_id":"","url":"https://api.github.com/users/mtsquire","html_url":"https://github.com/mtsquire","followers_url":"https://api.github.com/users/mtsquire/followers","following_url":"https://api.github.com/users/mtsquire/following{/other_user}","gists_url":"https://api.github.com/users/mtsquire/gists{/gist_id}","starred_url":"https://api.github.com/users/mtsquire/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mtsquire/subscriptions","organizations_url":"https://api.github.com/users/mtsquire/orgs","repos_url":"https://api.github.com/users/mtsquire/repos","events_url":"https://api.github.com/users/mtsquire/events{/privacy}","received_events_url":"https://api.github.com/users/mtsquire/received_events","type":"User","site_admin":false},"created_at":"2016-04-28T16:51:40Z","updated_at":"2016-04-28T16:51:40Z","body":"👍 makes sense to me"}}