Commit 2f1f200a authored by Sylvester Keil's avatar Sylvester Keil

Fix group_by local override

See #127
parent 7d4f6b49
...@@ -18,7 +18,7 @@ module Jekyll ...@@ -18,7 +18,7 @@ module Jekyll
module Utilities module Utilities
attr_reader :config, :site, :context, :prefix, :text, :offset, :max, :relative, :group_by attr_reader :config, :site, :context, :prefix, :text, :offset, :max, :relative
...@@ -203,13 +203,9 @@ module Jekyll ...@@ -203,13 +203,9 @@ module Jekyll
end end
def group_by def group_by
if group_by.nil? || group_by.empty? @group_by ||= config['group_by']
@group_by = config['group_by']
else
@group_by = 'none'
end
end end
def group? def group?
group_by != 'none' group_by != 'none'
end end
...@@ -230,7 +226,7 @@ module Jekyll ...@@ -230,7 +226,7 @@ module Jekyll
end end
grouper(ungrouped,group_keys,group_order) grouper(ungrouped,group_keys,group_order)
end end
def group_keys def group_keys
return @group_keys unless @group_keys.nil? return @group_keys unless @group_keys.nil?
...@@ -239,7 +235,7 @@ module Jekyll ...@@ -239,7 +235,7 @@ module Jekyll
.flatten .flatten
.map { |key| key == 'month' ? 'month_numeric' : key } .map { |key| key == 'month' ? 'month_numeric' : key }
end end
def group_order def group_order
return @group_order unless @group_order.nil? return @group_order unless @group_order.nil?
...@@ -247,7 +243,7 @@ module Jekyll ...@@ -247,7 +243,7 @@ module Jekyll
.map { |key| key.to_s.split(/\s*,\s*/) } .map { |key| key.to_s.split(/\s*,\s*/) }
.flatten .flatten
end end
def group_compare(key,v1,v2) def group_compare(key,v1,v2)
case key case key
when 'type' when 'type'
...@@ -266,7 +262,7 @@ module Jekyll ...@@ -266,7 +262,7 @@ module Jekyll
v1 <=> v2 v1 <=> v2
end end
end end
def group_value(key,item) def group_value(key,item)
case key case key
when 'type' when 'type'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment