# File lib/jekyll/site.rb, line 102 def read_posts(dir) base = File.join(self.source, dir, '_posts') return unless File.exists?(base) entries = Dir.chdir(base) { filter_entries(Dir['**/*']) } # first pass processes, but does not yet render post content entries.each do |f| if Post.valid?(f) post = Post.new(self, self.source, dir, f) if post.published && (self.future || post.date <= self.time) self.posts << post post.categories.each { |c| self.categories[c] << post } post.tags.each { |c| self.tags[c] << post } end end end self.posts.sort! end