{"action":"created","comment":{"url":"https://api.github.com/repos/benbalter/jekyll-readme-index/pulls/comments/93967386","pull_request_review_id":14497675,"id":93967386,"diff_hunk":"@@ -26,15 +28,38 @@ def readme\n     end\n \n     def index?\n-      (site.pages + site.static_files).any? { |file| file.url =~ INDEX_REGEX }\n+      relative_index?(readme)\n     end\n \n     def page\n+      relative_page(readme)\n+    end\n+\n+    def readmes\n+      site.static_files.each_with_object([]) do |file, memo|\n+        memo << file if file.relative_path =~ READMES_REGEX\n+      end\n+    end\n+\n+    def relative_index?(readme)","path":"lib/jekyll-readme-index/generator.rb","position":40,"original_position":40,"commit_id":"f341303fa4d3dc463cedfa3a183856a33f8a6dc6","original_commit_id":"f341303fa4d3dc463cedfa3a183856a33f8a6dc6","user":{"login":"benbalter","id":282759,"avatar_url":"https://avatars.githubusercontent.com/u/282759?v=3","gravatar_id":"","url":"https://api.github.com/users/benbalter","html_url":"https://github.com/benbalter","followers_url":"https://api.github.com/users/benbalter/followers","following_url":"https://api.github.com/users/benbalter/following{/other_user}","gists_url":"https://api.github.com/users/benbalter/gists{/gist_id}","starred_url":"https://api.github.com/users/benbalter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benbalter/subscriptions","organizations_url":"https://api.github.com/users/benbalter/orgs","repos_url":"https://api.github.com/users/benbalter/repos","events_url":"https://api.github.com/users/benbalter/events{/privacy}","received_events_url":"https://api.github.com/users/benbalter/received_events","type":"User","site_admin":true},"body":"Instead of passing around the readme itself, what if we had one method that got the relative path of the README's containing folder, and then another method that determined if that folder had an index? That way we can centralized the path traversal logic, and things should read a bit better to humans.","created_at":"2016-12-27T20:21:25Z","updated_at":"2016-12-27T20:22:08Z","html_url":"https://github.com/benbalter/jekyll-readme-index/pull/5#discussion_r93967386","pull_request_url":"https://api.github.com/repos/benbalter/jekyll-readme-index/pulls/5","_links":{"self":{"href":"https://api.github.com/repos/benbalter/jekyll-readme-index/pulls/comments/93967386"},"html":{"href":"https://github.com/benbalter/jekyll-readme-index/pull/5#discussion_r93967386"},"pull_request":{"href":"https://api.github.com/repos/benbalter/jekyll-readme-index/pulls/5"}}},"pull_request":{"url":"https://api.github.com/repos/benbalter/jekyll-readme-index/pulls/5","id":99355708,"html_url":"https://github.com/benbalter/jekyll-readme-index/pull/5","diff_url":"https://github.com/benbalter/jekyll-readme-index/pull/5.diff","patch_url":"https://github.com/benbalter/jekyll-readme-index/pull/5.patch","issue_url":"https://api.github.com/repos/benbalter/jekyll-readme-index/issues/5","number":5,"state":"open","locked":false,"title":"Add support for using README as index in folders as well","user":{"login":"tardate","id":16432,"avatar_url":"https://avatars.githubusercontent.com/u/16432?v=3","gravatar_id":"","url":"https://api.github.com/users/tardate","html_url":"https://github.com/tardate","followers_url":"https://api.github.com/users/tardate/followers","following_url":"https://api.github.com/users/tardate/following{/other_user}","gists_url":"https://api.github.com/users/tardate/gists{/gist_id}","starred_url":"https://api.github.com/users/tardate/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tardate/subscriptions","organizations_url":"https://api.github.com/users/tardate/orgs","repos_url":"https://api.github.com/users/tardate/repos","events_url":"https://api.github.com/users/tardate/events{/privacy}","received_events_url":"https://api.github.com/users/tardate/received_events","type":"User","site_admin":false},"body":"This is a possible fix for issue #2 \r\n\r\nIt generalises the generator so it maps all READMEs in a repository to corresponding index pages, not just from the root folder.\r\n\r\nI'm only a Jekyll newbie, so the modifications here may have created other problems. But in a few tests with Jekyll-generated sites, this seems to do the trick. I'd really appreciate someone else's eyes on the change to see if it might be worth merging.","created_at":"2016-12-26T09:43:33Z","updated_at":"2016-12-27T20:22:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e4f4b2bc17a02679d8036a46ac932b087a52ef03","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/benbalter/jekyll-readme-index/pulls/5/commits","review_comments_url":"https://api.github.com/repos/benbalter/jekyll-readme-index/pulls/5/comments","review_comment_url":"https://api.github.com/repos/benbalter/jekyll-readme-index/pulls/comments{/number}","comments_url":"https://api.github.com/repos/benbalter/jekyll-readme-index/issues/5/comments","statuses_url":"https://api.github.com/repos/benbalter/jekyll-readme-index/statuses/f341303fa4d3dc463cedfa3a183856a33f8a6dc6","head":{"label":"tardate:nested_readmes","ref":"nested_readmes","sha":"f341303fa4d3dc463cedfa3a183856a33f8a6dc6","user":{"login":"tardate","id":16432,"avatar_url":"https://avatars.githubusercontent.com/u/16432?v=3","gravatar_id":"","url":"https://api.github.com/users/tardate","html_url":"https://github.com/tardate","followers_url":"https://api.github.com/users/tardate/followers","following_url":"https://api.github.com/users/tardate/following{/other_user}","gists_url":"https://api.github.com/users/tardate/gists{/gist_id}","starred_url":"https://api.github.com/users/tardate/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tardate/subscriptions","organizations_url":"https://api.github.com/users/tardate/orgs","repos_url":"https://api.github.com/users/tardate/repos","events_url":"https://api.github.com/users/tardate/events{/privacy}","received_events_url":"https://api.github.com/users/tardate/received_events","type":"User","site_admin":false},"repo":{"id":77373868,"name":"jekyll-readme-index","full_name":"tardate/jekyll-readme-index","owner":{"login":"tardate","id":16432,"avatar_url":"https://avatars.githubusercontent.com/u/16432?v=3","gravatar_id":"","url":"https://api.github.com/users/tardate","html_url":"https://github.com/tardate","followers_url":"https://api.github.com/users/tardate/followers","following_url":"https://api.github.com/users/tardate/following{/other_user}","gists_url":"https://api.github.com/users/tardate/gists{/gist_id}","starred_url":"https://api.github.com/users/tardate/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tardate/subscriptions","organizations_url":"https://api.github.com/users/tardate/orgs","repos_url":"https://api.github.com/users/tardate/repos","events_url":"https://api.github.com/users/tardate/events{/privacy}","received_events_url":"https://api.github.com/users/tardate/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tardate/jekyll-readme-index","description":"A Jekyll plugin to render a project's README as the site's index.","fork":true,"url":"https://api.github.com/repos/tardate/jekyll-readme-index","forks_url":"https://api.github.com/repos/tardate/jekyll-readme-index/forks","keys_url":"https://api.github.com/repos/tardate/jekyll-readme-index/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tardate/jekyll-readme-index/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tardate/jekyll-readme-index/teams","hooks_url":"https://api.github.com/repos/tardate/jekyll-readme-index/hooks","issue_events_url":"https://api.github.com/repos/tardate/jekyll-readme-index/issues/events{/number}","events_url":"https://api.github.com/repos/tardate/jekyll-readme-index/events","assignees_url":"https://api.github.com/repos/tardate/jekyll-readme-index/assignees{/user}","branches_url":"https://api.github.com/repos/tardate/jekyll-readme-index/branches{/branch}","tags_url":"https://api.github.com/repos/tardate/jekyll-readme-index/tags","blobs_url":"https://api.github.com/repos/tardate/jekyll-readme-index/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tardate/jekyll-readme-index/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tardate/jekyll-readme-index/git/refs{/sha}","trees_url":"https://api.github.com/repos/tardate/jekyll-readme-index/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tardate/jekyll-readme-index/statuses/{sha}","languages_url":"https://api.github.com/repos/tardate/jekyll-readme-index/languages","stargazers_url":"https://api.github.com/repos/tardate/jekyll-readme-index/stargazers","contributors_url":"https://api.github.com/repos/tardate/jekyll-readme-index/contributors","subscribers_url":"https://api.github.com/repos/tardate/jekyll-readme-index/subscribers","subscription_url":"https://api.github.com/repos/tardate/jekyll-readme-index/subscription","commits_url":"https://api.github.com/repos/tardate/jekyll-readme-index/commits{/sha}","git_commits_url":"https://api.github.com/repos/tardate/jekyll-readme-index/git/commits{/sha}","comments_url":"https://api.github.com/repos/tardate/jekyll-readme-index/comments{/number}","issue_comment_url":"https://api.github.com/repos/tardate/jekyll-readme-index/issues/comments{/number}","contents_url":"https://api.github.com/repos/tardate/jekyll-readme-index/contents/{+path}","compare_url":"https://api.github.com/repos/tardate/jekyll-readme-index/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tardate/jekyll-readme-index/merges","archive_url":"https://api.github.com/repos/tardate/jekyll-readme-index/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tardate/jekyll-readme-index/downloads","issues_url":"https://api.github.com/repos/tardate/jekyll-readme-index/issues{/number}","pulls_url":"https://api.github.com/repos/tardate/jekyll-readme-index/pulls{/number}","milestones_url":"https://api.github.com/repos/tardate/jekyll-readme-index/milestones{/number}","notifications_url":"https://api.github.com/repos/tardate/jekyll-readme-index/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tardate/jekyll-readme-index/labels{/name}","releases_url":"https://api.github.com/repos/tardate/jekyll-readme-index/releases{/id}","deployments_url":"https://api.github.com/repos/tardate/jekyll-readme-index/deployments","created_at":"2016-12-26T09:37:30Z","updated_at":"2016-12-26T09:37:32Z","pushed_at":"2016-12-27T10:20:58Z","git_url":"git://github.com/tardate/jekyll-readme-index.git","ssh_url":"git@github.com:tardate/jekyll-readme-index.git","clone_url":"https://github.com/tardate/jekyll-readme-index.git","svn_url":"https://github.com/tardate/jekyll-readme-index","homepage":"","size":16,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"benbalter:master","ref":"master","sha":"dbba22b777b8f519d70743f4006eabe1942fa22a","user":{"login":"benbalter","id":282759,"avatar_url":"https://avatars.githubusercontent.com/u/282759?v=3","gravatar_id":"","url":"https://api.github.com/users/benbalter","html_url":"https://github.com/benbalter","followers_url":"https://api.github.com/users/benbalter/followers","following_url":"https://api.github.com/users/benbalter/following{/other_user}","gists_url":"https://api.github.com/users/benbalter/gists{/gist_id}","starred_url":"https://api.github.com/users/benbalter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benbalter/subscriptions","organizations_url":"https://api.github.com/users/benbalter/orgs","repos_url":"https://api.github.com/users/benbalter/repos","events_url":"https://api.github.com/users/benbalter/events{/privacy}","received_events_url":"https://api.github.com/users/benbalter/received_events","type":"User","site_admin":true},"repo":{"id":67887394,"name":"jekyll-readme-index","full_name":"benbalter/jekyll-readme-index","owner":{"login":"benbalter","id":282759,"avatar_url":"https://avatars.githubusercontent.com/u/282759?v=3","gravatar_id":"","url":"https://api.github.com/users/benbalter","html_url":"https://github.com/benbalter","followers_url":"https://api.github.com/users/benbalter/followers","following_url":"https://api.github.com/users/benbalter/following{/other_user}","gists_url":"https://api.github.com/users/benbalter/gists{/gist_id}","starred_url":"https://api.github.com/users/benbalter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benbalter/subscriptions","organizations_url":"https://api.github.com/users/benbalter/orgs","repos_url":"https://api.github.com/users/benbalter/repos","events_url":"https://api.github.com/users/benbalter/events{/privacy}","received_events_url":"https://api.github.com/users/benbalter/received_events","type":"User","site_admin":true},"private":false,"html_url":"https://github.com/benbalter/jekyll-readme-index","description":"A Jekyll plugin to render a project's README as the site's index.","fork":false,"url":"https://api.github.com/repos/benbalter/jekyll-readme-index","forks_url":"https://api.github.com/repos/benbalter/jekyll-readme-index/forks","keys_url":"https://api.github.com/repos/benbalter/jekyll-readme-index/keys{/key_id}","collaborators_url":"https://api.github.com/repos/benbalter/jekyll-readme-index/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/benbalter/jekyll-readme-index/teams","hooks_url":"https://api.github.com/repos/benbalter/jekyll-readme-index/hooks","issue_events_url":"https://api.github.com/repos/benbalter/jekyll-readme-index/issues/events{/number}","events_url":"https://api.github.com/repos/benbalter/jekyll-readme-index/events","assignees_url":"https://api.github.com/repos/benbalter/jekyll-readme-index/assignees{/user}","branches_url":"https://api.github.com/repos/benbalter/jekyll-readme-index/branches{/branch}","tags_url":"https://api.github.com/repos/benbalter/jekyll-readme-index/tags","blobs_url":"https://api.github.com/repos/benbalter/jekyll-readme-index/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/benbalter/jekyll-readme-index/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/benbalter/jekyll-readme-index/git/refs{/sha}","trees_url":"https://api.github.com/repos/benbalter/jekyll-readme-index/git/trees{/sha}","statuses_url":"https://api.github.com/repos/benbalter/jekyll-readme-index/statuses/{sha}","languages_url":"https://api.github.com/repos/benbalter/jekyll-readme-index/languages","stargazers_url":"https://api.github.com/repos/benbalter/jekyll-readme-index/stargazers","contributors_url":"https://api.github.com/repos/benbalter/jekyll-readme-index/contributors","subscribers_url":"https://api.github.com/repos/benbalter/jekyll-readme-index/subscribers","subscription_url":"https://api.github.com/repos/benbalter/jekyll-readme-index/subscription","commits_url":"https://api.github.com/repos/benbalter/jekyll-readme-index/commits{/sha}","git_commits_url":"https://api.github.com/repos/benbalter/jekyll-readme-index/git/commits{/sha}","comments_url":"https://api.github.com/repos/benbalter/jekyll-readme-index/comments{/number}","issue_comment_url":"https://api.github.com/repos/benbalter/jekyll-readme-index/issues/comments{/number}","contents_url":"https://api.github.com/repos/benbalter/jekyll-readme-index/contents/{+path}","compare_url":"https://api.github.com/repos/benbalter/jekyll-readme-index/compare/{base}...{head}","merges_url":"https://api.github.com/repos/benbalter/jekyll-readme-index/merges","archive_url":"https://api.github.com/repos/benbalter/jekyll-readme-index/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/benbalter/jekyll-readme-index/downloads","issues_url":"https://api.github.com/repos/benbalter/jekyll-readme-index/issues{/number}","pulls_url":"https://api.github.com/repos/benbalter/jekyll-readme-index/pulls{/number}","milestones_url":"https://api.github.com/repos/benbalter/jekyll-readme-index/milestones{/number}","notifications_url":"https://api.github.com/repos/benbalter/jekyll-readme-index/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/benbalter/jekyll-readme-index/labels{/name}","releases_url":"https://api.github.com/repos/benbalter/jekyll-readme-index/releases{/id}","deployments_url":"https://api.github.com/repos/benbalter/jekyll-readme-index/deployments","created_at":"2016-09-10T18:24:10Z","updated_at":"2016-12-21T10:35:54Z","pushed_at":"2016-12-27T10:20:59Z","git_url":"git://github.com/benbalter/jekyll-readme-index.git","ssh_url":"git@github.com:benbalter/jekyll-readme-index.git","clone_url":"https://github.com/benbalter/jekyll-readme-index.git","svn_url":"https://github.com/benbalter/jekyll-readme-index","homepage":"","size":12,"stargazers_count":9,"watchers_count":9,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":3,"forks":5,"open_issues":3,"watchers":9,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/benbalter/jekyll-readme-index/pulls/5"},"html":{"href":"https://github.com/benbalter/jekyll-readme-index/pull/5"},"issue":{"href":"https://api.github.com/repos/benbalter/jekyll-readme-index/issues/5"},"comments":{"href":"https://api.github.com/repos/benbalter/jekyll-readme-index/issues/5/comments"},"review_comments":{"href":"https://api.github.com/repos/benbalter/jekyll-readme-index/pulls/5/comments"},"review_comment":{"href":"https://api.github.com/repos/benbalter/jekyll-readme-index/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/benbalter/jekyll-readme-index/pulls/5/commits"},"statuses":{"href":"https://api.github.com/repos/benbalter/jekyll-readme-index/statuses/f341303fa4d3dc463cedfa3a183856a33f8a6dc6"}}}}
{"actor":{"display_login":"benbalter"}}