Support real and natural custom collections in autopages #234
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi, I updated the logic in autopages to properly support custom collections in a very natural way.
collections_dir
in jekyll, titles, url permalink, etcThe way this works now with a config like this
The purpose of
indexkey
is this:_authors/someauthor.md
), you will have a unique key in it that matches theindexkey
, in my case here it's set toauthor
. The key insidesomeauthor.md
for this example isauthor: someauthor
author: someauthor
. Of course, you must also specify thefilter_collection
option to enable thisBy thus doing, we have pagination for custom collections which filter out the posts with matching keys on custom collections
title
if there's a conflict), and it'll also render out the document and setpage.content
so we can access the entire collections data inside the layout as if it was a real page.Please be gentle with me, I'm very new to Ruby and didn't even know it a week ago. Never used Ruby before
Edit: I accidentally left in a fix in here for #219. I'll just leave it there