I'm trying to create a Jekyll plugin to paginate author pages, but can't seem to get over the first hurdle.
I'm basing my attempt on an existing plugin, and I'm stumbling when trying to elect pages by author. The original plugin was for categories, and its site select looks like this:
category_posts = site.categories[page.data['category']].sort_by { |p| -p.date.to_f }
I was hoping something like this would work (my author info is contained in _data/authors.yml):
author_posts = site.data['authors'][page.data['author']].sort_by { |p| -p.date.to_f }
But that doesn't work. I've also tried:
author_posts = site.data.authors[page.data['author']].sort_by { |p| -p.date.to_f }
And that also falls (with a NOMETHOD error on 'author').
Does anyone have any suggestions on the correct way to do this?
Thanks.