{"action":"created","issue":{"url":"https://api.github.com/repos/nymag/amphora/issues/179","labels_url":"https://api.github.com/repos/nymag/amphora/issues/179/labels{/name}","comments_url":"https://api.github.com/repos/nymag/amphora/issues/179/comments","events_url":"https://api.github.com/repos/nymag/amphora/issues/179/events","html_url":"https://github.com/nymag/amphora/pull/179","id":118721896,"number":179,"title":"resolve-media-map","user":{"login":"TakenPilot","id":4154804,"avatar_url":"https://avatars.githubusercontent.com/u/4154804?v=3","gravatar_id":"","url":"https://api.github.com/users/TakenPilot","html_url":"https://github.com/TakenPilot","followers_url":"https://api.github.com/users/TakenPilot/followers","following_url":"https://api.github.com/users/TakenPilot/following{/other_user}","gists_url":"https://api.github.com/users/TakenPilot/gists{/gist_id}","starred_url":"https://api.github.com/users/TakenPilot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TakenPilot/subscriptions","organizations_url":"https://api.github.com/users/TakenPilot/orgs","repos_url":"https://api.github.com/users/TakenPilot/repos","events_url":"https://api.github.com/users/TakenPilot/events{/privacy}","received_events_url":"https://api.github.com/users/TakenPilot/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-11-24T22:58:37Z","updated_at":"2015-11-24T23:01:32Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/nymag/amphora/pulls/179","html_url":"https://github.com/nymag/amphora/pull/179","diff_url":"https://github.com/nymag/amphora/pull/179.diff","patch_url":"https://github.com/nymag/amphora/pull/179.patch"},"body":"New Feature\r\n- Allow sites to modify the media map used within a template.\r\n\r\nFor example\r\n```js\r\nmodule.exports = function (router, composer) {\r\n\r\n  router.get('/', composer);\r\n  router.get('/:year/:month/:name', composer);\r\n\r\n  return router;\r\n};\r\n\r\nmodule.exports.resolveMedia = function (media, locals) {\r\n  const assetPath = locals.site.assetPath;\r\n\r\n  if (locals.edit) {\r\n    media.scripts = [assetPath + '/js/edit-before.js'];\r\n  } else {\r\n    media.scripts.unshift(assetPath + '/js/view-before.js');\r\n    media.scripts.push(assetPath + '/js/view-after.js');\r\n  }\r\n};\r\n```"},"comment":{"url":"https://api.github.com/repos/nymag/amphora/issues/comments/159433252","html_url":"https://github.com/nymag/amphora/pull/179#issuecomment-159433252","issue_url":"https://api.github.com/repos/nymag/amphora/issues/179","id":159433252,"user":{"login":"TakenPilot","id":4154804,"avatar_url":"https://avatars.githubusercontent.com/u/4154804?v=3","gravatar_id":"","url":"https://api.github.com/users/TakenPilot","html_url":"https://github.com/TakenPilot","followers_url":"https://api.github.com/users/TakenPilot/followers","following_url":"https://api.github.com/users/TakenPilot/following{/other_user}","gists_url":"https://api.github.com/users/TakenPilot/gists{/gist_id}","starred_url":"https://api.github.com/users/TakenPilot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TakenPilot/subscriptions","organizations_url":"https://api.github.com/users/TakenPilot/orgs","repos_url":"https://api.github.com/users/TakenPilot/repos","events_url":"https://api.github.com/users/TakenPilot/events{/privacy}","received_events_url":"https://api.github.com/users/TakenPilot/received_events","type":"User","site_admin":false},"created_at":"2015-11-24T23:01:32Z","updated_at":"2015-11-24T23:01:32Z","body":"I'll be putting coverage at a pure 100% this PR as well, I guess.  It's time, after all."}}