SpicyJekyll is a Jekyll plugin that adds sensible default behaviors to your custom collections. Like real spices, SpicyJekyll makes your custom collections tastier to consume. ♨️ 👍
Copy spicy_collections.rb to your Jekyll plugins directory. That's it!
For each custom collection you have, add an entry to your collections hash in _config.yml:
collections:
  authors:
  recipes:SpicyJekyll expects to see the members of that collection as files in _{collection-name} in your configured source directory. For example, each recipe would be a file in _recipes.
Then provide a refname key to tell SpicyJekyll how to find these files. SpicyJekyll will look for files named ...<refname>-... in this file and process them (see "Behavior" below).
collections:
  authors:
    refname: author
For example, you can organize your authors like this:
_authors/
  author-smith-alice.markdown
  author-feminella-john.markdown
  author-gupta-steve.markdown
  author-breckenridge-jen.markdown
The portion before the refname is reserved for your use so that you can have a convenient filename-based id-number sort if that's relevant to your collection. For example, if your authors have employee ID numbers and it's more useful to sort by those, then you can do that:
_authors/
  000001-author-smith-alice.markdown
  000002-author-feminella-john.markdown
  000003-author-gupta-steve.markdown
  000004-author-breckenridge-jen.markdown
If not, you can just ignore that, and use the first example.
Running SpicyJekyll on a custom collection has the following effects. Your collection will:
- 
Be ordered by a
datefield. If you would rather sort by a different field, set thesort_bykey on your collection. For example, to sort by a field calledlast_name, addsort_by: last_nameto your collection's metadata in_config.yml. The sorting is in ascending order. If you want to sort by descending, use thereversefilter. - 
Have its documents augmented with
nextandpreviousreferences. The aforementioned ordering will be used to sort your collection. The first document will have anilreference topreviousand the last document will have anilreference tonext. Each navigation reference is a hash containingtitleandurl` fields. This is helpful for showing next/previous navigation links in your templates, for instance. - 
Be rigorously checked for a
titleproperty on each document. This prevents Jekyll's silent errors for missing keys. If a title is missing from any document, it will be considered a fatal error and your site's build will halt. - 
Have stable permalinks. Every collection gets a permalink slug based on the filename. This lets you change the title or headline of the document without affecting its slug, so long as you leave the filename alone. This is helpful when you don't want to break URLs inadvertently.
 - 
Log what it's doing. For each member of the collection, Jekyll will log useful output to let you know that your element was processed. This lets you more quickly diagnose any issues that might be present in your collections.