{"action":"created","issue":{"url":"https://api.github.com/repos/18F/hub/issues/69","labels_url":"https://api.github.com/repos/18F/hub/issues/69/labels{/name}","comments_url":"https://api.github.com/repos/18F/hub/issues/69/comments","events_url":"https://api.github.com/repos/18F/hub/issues/69/events","html_url":"https://github.com/18F/hub/pull/69","id":54994324,"number":69,"title":"create an API for pages","user":{"login":"afeld","id":86842,"avatar_url":"https://avatars.githubusercontent.com/u/86842?v=3","gravatar_id":"","url":"https://api.github.com/users/afeld","html_url":"https://github.com/afeld","followers_url":"https://api.github.com/users/afeld/followers","following_url":"https://api.github.com/users/afeld/following{/other_user}","gists_url":"https://api.github.com/users/afeld/gists{/gist_id}","starred_url":"https://api.github.com/users/afeld/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/afeld/subscriptions","organizations_url":"https://api.github.com/users/afeld/orgs","repos_url":"https://api.github.com/users/afeld/repos","events_url":"https://api.github.com/users/afeld/events{/privacy}","received_events_url":"https://api.github.com/users/afeld/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-01-21T09:13:17Z","updated_at":"2015-01-26T23:00:36Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/18F/hub/pulls/69","html_url":"https://github.com/18F/hub/pull/69","diff_url":"https://github.com/18F/hub/pull/69.diff","patch_url":"https://github.com/18F/hub/pull/69.patch"},"body":"This is one part of https://github.com/18F/hub/issues/42: generating a JSON file with data about the site's pages. This PR temporarily includes two approaches:\r\n\r\n* A Liquid template to generate the JSON, as suggested by @gjtorikian in https://github.com/18F/hub/issues/42#issuecomment-69274205\r\n    * Pro: doesn't require any plugin.\r\n    * Con: the manual escaping of the values is fragile and messy. We have JSON encoding built into Ruby, so why not use it.\r\n* An addition to our API plugin to generate `/api/pages/`\r\n    * Pro: will be easier to extract to a gem\r\n    * Con: it requires a plugin, which means it won't work on GitHub Pages\r\n\r\nMy plan is to go with the latter, but there are a couple outstanding issues:\r\n\r\n* [x] The two approaches are currently generating slightly different content, though I'm having trouble figuring out why they differ.\r\n* [x] The templates aren't being evaluated (in either case), so I'm getting JSON that looks like this:\r\n\r\n    ```json\r\n    {\r\n      \"title\": \"\",\r\n      \"url\": \"/wg/\",\r\n      \"body\": \"Working Groups  {% for wg in site.data.working_groups %} ...\"\r\n    }\r\n    ```\r\n\r\nHalp!"},"comment":{"url":"https://api.github.com/repos/18F/hub/issues/comments/71557042","html_url":"https://github.com/18F/hub/pull/69#issuecomment-71557042","issue_url":"https://api.github.com/repos/18F/hub/issues/69","id":71557042,"user":{"login":"afeld","id":86842,"avatar_url":"https://avatars.githubusercontent.com/u/86842?v=3","gravatar_id":"","url":"https://api.github.com/users/afeld","html_url":"https://github.com/afeld","followers_url":"https://api.github.com/users/afeld/followers","following_url":"https://api.github.com/users/afeld/following{/other_user}","gists_url":"https://api.github.com/users/afeld/gists{/gist_id}","starred_url":"https://api.github.com/users/afeld/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/afeld/subscriptions","organizations_url":"https://api.github.com/users/afeld/orgs","repos_url":"https://api.github.com/users/afeld/repos","events_url":"https://api.github.com/users/afeld/events{/privacy}","received_events_url":"https://api.github.com/users/afeld/received_events","type":"User","site_admin":false},"created_at":"2015-01-26T23:00:36Z","updated_at":"2015-01-26T23:00:36Z","body":"@mbland Updated to use the gem, to split out the backend changes from https://github.com/18F/hub/pull/80."}}