diff --git a/_plugins/jekyll-autgenerator.rb b/_plugins/jekyll-autgenerator.rb index 9a1b80500..108a129d8 100755 --- a/_plugins/jekyll-autgenerator.rb +++ b/_plugins/jekyll-autgenerator.rb @@ -5,8 +5,9 @@ class AuthorsGenerator < Generator safe true def generate(site) - site.categories.each do |author| - build_subpages(site, "author", author) + site.data['authors'].each do |author, data| + posts = [author, posts_by_author(site, author)] + build_subpages(site, 'author', posts) end end @@ -36,6 +37,12 @@ def paginate(site, type, posts) end end + + private + + def posts_by_author(site, author) + site.posts.docs.select { |post| post.data['author'] == author } + end end class GroupSubPageAuthor < Page