File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -131,7 +131,7 @@ def post_attr_hash(post_attr)
131131 # Build a hash map based on the specified post attribute ( post attr =>
132132 # array of posts ) then sort each array in reverse order.
133133 hash = Hash . new { |h , key | h [ key ] = [ ] }
134- @posts . each { |p | p . send ( post_attr . to_sym ) . each { |t | hash [ t ] << p } }
134+ @posts . docs . each { |p | p . data [ post_attr ] . each { |t | hash [ t ] << p } }
135135 hash . values . each { |posts | posts . sort! . reverse! }
136136 hash
137137 end
@@ -147,7 +147,7 @@ def categories
147147 # Custom `post_attr_hash` method for years
148148 def years
149149 hash = Hash . new { |h , key | h [ key ] = [ ] }
150- @posts . each { |p | hash [ p . date . strftime ( "%Y" ) ] << p }
150+ @posts . docs . each { |p | hash [ p . date . strftime ( "%Y" ) ] << p }
151151 hash . values . each { |posts | posts . sort! . reverse! }
152152 hash
153153 end
You can’t perform that action at this time.
0 commit comments