Using this plugin, but it is being applied to a data YML file in Jekyll and I wonder if that is why I am getting the above error. Anyone know how I might change the plug in code to apply this to a data file instead of a collection?
module Jekyll
module DateFilter
require 'date'
def date_sort(collection)
collection.sort_by do |el|
Date.parse(el.data['date'], '%b %-d %Y')
end
end
end
end
Liquid::Template.register_filter(Jekyll::DateFilter)
The error again is:
Error: undefined method `data' for #<Hash:0x007f859f5e9d78>
Being applied this way:
{%- assign comments = site.data.comments | sort date_sort -%}