{"action":"created","issue":{"url":"https://api.github.com/repos/jenius/roots/issues/599","labels_url":"https://api.github.com/repos/jenius/roots/issues/599/labels{/name}","comments_url":"https://api.github.com/repos/jenius/roots/issues/599/comments","events_url":"https://api.github.com/repos/jenius/roots/issues/599/events","html_url":"https://github.com/jenius/roots/issues/599","id":54070556,"number":599,"title":"[v2] layouts not working","user":{"login":"teichmaj","id":5422919,"avatar_url":"https://avatars.githubusercontent.com/u/5422919?v=3","gravatar_id":"","url":"https://api.github.com/users/teichmaj","html_url":"https://github.com/teichmaj","followers_url":"https://api.github.com/users/teichmaj/followers","following_url":"https://api.github.com/users/teichmaj/following{/other_user}","gists_url":"https://api.github.com/users/teichmaj/gists{/gist_id}","starred_url":"https://api.github.com/users/teichmaj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/teichmaj/subscriptions","organizations_url":"https://api.github.com/users/teichmaj/orgs","repos_url":"https://api.github.com/users/teichmaj/repos","events_url":"https://api.github.com/users/teichmaj/events{/privacy}","received_events_url":"https://api.github.com/users/teichmaj/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-01-12T16:01:31Z","updated_at":"2015-02-18T23:16:09Z","closed_at":"2015-02-18T16:32:38Z","body":"I'm new to roots and liked it a lot so far. The only thing which bugs me is that I cannot get layouts working.\r\n\r\nIn app.coffee I define two layouts:\r\n```\r\nlayouts:\r\n  default: 'layout.jade'\r\n  'privacy.jade': 'plain_layout.jade'\r\n```\r\n\r\nI added some console.log and I noticed that the overwrite of the default layout never happens.\r\n\r\nhttps://github.com/jenius/roots/blob/master/lib/extensions/layouts.coffee#L71\r\n```\r\n# if there's a custom override, use that instead\r\nlayout = roots.project.layouts[key] for key of roots.project.layouts if key is rel_file\r\n```\r\n\r\nHowever, the compile js version of that file on my local machine reads:\r\n```\r\n// Generated by CoffeeScript 1.7.0\r\nif (key === rel_file) {\r\n  for (key in roots.project.layouts) {\r\n    layout = roots.project.layouts[key];\r\n  }\r\n}\r\n```\r\nand if I'm not mistaken this if condition is never true as key is always undefined, and therefore the layout overwrite never occurs."},"comment":{"url":"https://api.github.com/repos/jenius/roots/issues/comments/74969592","html_url":"https://github.com/jenius/roots/issues/599#issuecomment-74969592","issue_url":"https://api.github.com/repos/jenius/roots/issues/599","id":74969592,"user":{"login":"teichmaj","id":5422919,"avatar_url":"https://avatars.githubusercontent.com/u/5422919?v=3","gravatar_id":"","url":"https://api.github.com/users/teichmaj","html_url":"https://github.com/teichmaj","followers_url":"https://api.github.com/users/teichmaj/followers","following_url":"https://api.github.com/users/teichmaj/following{/other_user}","gists_url":"https://api.github.com/users/teichmaj/gists{/gist_id}","starred_url":"https://api.github.com/users/teichmaj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/teichmaj/subscriptions","organizations_url":"https://api.github.com/users/teichmaj/orgs","repos_url":"https://api.github.com/users/teichmaj/repos","events_url":"https://api.github.com/users/teichmaj/events{/privacy}","received_events_url":"https://api.github.com/users/teichmaj/received_events","type":"User","site_admin":false},"created_at":"2015-02-18T23:16:09Z","updated_at":"2015-02-18T23:16:09Z","body":"Good job for releasing v3! I will give it a try when I have some time. Unfortunately, I moved away from roots to grunt for the project I am currently working on. So I haven't tried to fix it up and I'm not very optimistic I will find the time any time soon :( "}}