diff --git a/app/models/post.rb b/app/models/post.rb index 097543b0..227ef744 100644 --- a/app/models/post.rb +++ b/app/models/post.rb @@ -57,6 +57,8 @@ class Post end end + args[:layout] = args[:site].layouts[args[:layout]] if args[:layout].is_a? Symbol + Post.new(**args) end end diff --git a/app/models/site/index.rb b/app/models/site/index.rb index 2cb950cb..7a070e6d 100644 --- a/app/models/site/index.rb +++ b/app/models/site/index.rb @@ -20,7 +20,7 @@ class Site jekyll.documents.each do |doc| doc.read! - Post.new(document: doc, site: self, layout: layouts[doc['layout'].to_sym]).index! + Post.new(document: doc, site: self, layout: doc['layout'].to_sym).index! end update(last_indexed_commit: repository.head_commit.oid)