diff --git a/app/models/site/index.rb b/app/models/site/index.rb index e11095e3..20914905 100644 --- a/app/models/site/index.rb +++ b/app/models/site/index.rb @@ -14,7 +14,14 @@ class Site def index_posts! Site.transaction do - docs.each(&:index!) + jekyll.read + jekyll.documents.each do |doc| + doc.read! + + Post.new(document: doc, site: self, layout: layouts[doc['layout'].to_sym).index! + end + + update(last_indexed_commit: repository.head_commit.oid) end end end