{"action":"created","issue":{"url":"https://api.github.com/repos/carrot/roots-contentful/issues/31","labels_url":"https://api.github.com/repos/carrot/roots-contentful/issues/31/labels{/name}","comments_url":"https://api.github.com/repos/carrot/roots-contentful/issues/31/comments","events_url":"https://api.github.com/repos/carrot/roots-contentful/issues/31/events","html_url":"https://github.com/carrot/roots-contentful/issues/31","id":110847658,"number":31,"title":"roots-contentful doesn' play well with roots-yaml","user":{"login":"axelboc","id":2936402,"avatar_url":"https://avatars.githubusercontent.com/u/2936402?v=3","gravatar_id":"","url":"https://api.github.com/users/axelboc","html_url":"https://github.com/axelboc","followers_url":"https://api.github.com/users/axelboc/followers","following_url":"https://api.github.com/users/axelboc/following{/other_user}","gists_url":"https://api.github.com/users/axelboc/gists{/gist_id}","starred_url":"https://api.github.com/users/axelboc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/axelboc/subscriptions","organizations_url":"https://api.github.com/users/axelboc/orgs","repos_url":"https://api.github.com/users/axelboc/repos","events_url":"https://api.github.com/users/axelboc/events{/privacy}","received_events_url":"https://api.github.com/users/axelboc/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-10-11T10:28:57Z","updated_at":"2015-11-05T06:09:58Z","closed_at":null,"body":"I'm trying to use **roots-contentful** in combination with **[roots-yaml](https://github.com/carrot/roots-yaml)**. Basically I need to access the `data` object created by roots-yaml from inside the single entry views compiled by roots-contentful. Unfortunately, the `data` object is `undefined` when I try to reference it from my views.\r\n\r\nThe problem seems to be that the views are compiled during the set-up of roots-contentful (inside the `setup` hook), but the `data` object is created by roots-yaml much later, in the `before_pass` compile hook.\r\n\r\nThe `ordered` flag has no effect, of course, since the extension is not dealing with files like roots-yaml is. If roots extensions had some sort of `cleanup` hook, the compilation could be moved in there, but there isn't.\r\n\r\nThe only solution I could find is to make the `compile_entries` function available on the Roots object, and to call it from the `after` hook in my project's `app.coffee`.\r\n\r\n`root-contentful/lib/index.coffee`\r\n```coffee\r\n# ...\r\n\r\n    setup: ->\r\n      types = opts.content_types\r\n      types = if _.isPlainObject(types) then reconfigure_alt_type_config(types)\r\n      @roots.compileContentfulViews = compile_entries.bind(@, types)\r\n      \r\n      configure_content(types).with(@)\r\n        .then(get_all_content)\r\n        .tap(set_urls)\r\n        .tap(set_locals)\r\n\r\n# ...\r\n```\r\n\r\n`app.coffee`\r\n```coffee\r\n# ...\r\n\r\n    after: (roots) ->\r\n      roots.compileContentfulViews()\r\n\r\n# ...\r\n```"},"comment":{"url":"https://api.github.com/repos/carrot/roots-contentful/issues/comments/153966187","html_url":"https://github.com/carrot/roots-contentful/issues/31#issuecomment-153966187","issue_url":"https://api.github.com/repos/carrot/roots-contentful/issues/31","id":153966187,"user":{"login":"signorekai","id":12168407,"avatar_url":"https://avatars.githubusercontent.com/u/12168407?v=3","gravatar_id":"","url":"https://api.github.com/users/signorekai","html_url":"https://github.com/signorekai","followers_url":"https://api.github.com/users/signorekai/followers","following_url":"https://api.github.com/users/signorekai/following{/other_user}","gists_url":"https://api.github.com/users/signorekai/gists{/gist_id}","starred_url":"https://api.github.com/users/signorekai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/signorekai/subscriptions","organizations_url":"https://api.github.com/users/signorekai/orgs","repos_url":"https://api.github.com/users/signorekai/repos","events_url":"https://api.github.com/users/signorekai/events{/privacy}","received_events_url":"https://api.github.com/users/signorekai/received_events","type":"User","site_admin":false},"created_at":"2015-11-05T06:09:58Z","updated_at":"2015-11-05T06:09:58Z","body":"+1 for issue."}}