diff --git a/lib/jekyll/reader.rb b/lib/jekyll/reader.rb index a77b74ac..7c34ac33 100644 --- a/lib/jekyll/reader.rb +++ b/lib/jekyll/reader.rb @@ -122,5 +122,14 @@ module Jekyll name.gsub!(/(^|\b\s)\s+($|\s?\b)/, '\\1\\2') name.gsub(/\s+/, '_') end + + # Aggregate post information + # + # post - The Post object to aggregate information for + # + # Returns nothing + def aggregate_post_info(post) + site.posts << post + end end end \ No newline at end of file diff --git a/lib/jekyll/site.rb b/lib/jekyll/site.rb index d95e5dcc..6dae33f7 100644 --- a/lib/jekyll/site.rb +++ b/lib/jekyll/site.rb @@ -178,7 +178,7 @@ module Jekyll posts = reader.read_content(dir, '_posts', Post) posts.each do |post| - aggregate_post_info(post) if publisher.publish?(post) + reader.aggregate_post_info(post) if publisher.publish?(post) end end @@ -193,7 +193,7 @@ module Jekyll drafts.each do |draft| if draft.published? - aggregate_post_info(draft) + reader.aggregate_post_info(draft) end end end @@ -355,15 +355,6 @@ module Jekyll end end - # Aggregate post information - # - # post - The Post object to aggregate information for - # - # Returns nothing - def aggregate_post_info(post) - posts << post - end - def relative_permalinks_deprecation_method if config['relative_permalinks'] && has_relative_page? Jekyll::Deprecator.deprecation_message "Since v2.0, permalinks for pages" +