Skip to content

Commit

Permalink
Pass the site variable to posts_by_author.
Browse files Browse the repository at this point in the history
  • Loading branch information
dceluis committed Dec 14, 2017
1 parent da6e484 commit a125898
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions _plugins/jekyll-autgenerator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class AuthorsGenerator < Generator

def generate(site)
site.data['authors'].each do |author, data|
posts = [author, posts_by_author(author)]
posts = [author, posts_by_author(site, author)]
build_subpages(site, 'author', posts)
end
end
Expand Down Expand Up @@ -40,7 +40,7 @@ def paginate(site, type, posts)

private

def posts_by_author(author)
def posts_by_author(site, author)
site.posts.docs.select { |post| post.data['author'] == author }
end
end
Expand Down

0 comments on commit a125898

Please sign in to comment.