diff --git a/app/models/site/index.rb b/app/models/site/index.rb index 7a070e6d..dc9f266f 100644 --- a/app/models/site/index.rb +++ b/app/models/site/index.rb @@ -104,9 +104,10 @@ class Site indexable_posts.select do |delta| MODIFIED_STATUSES.include? delta.status end.each do |delta| - locale, path = locale_and_path_from(delta.new_file[:path]) + locale, _ = locale_and_path_from(delta.new_file[:path]) + full_path = File.join(self.path, delta.new_file[:path]) - posts(lang: locale).find(path).index! + Post.build(path: full_path, site: self, layout: Post.find_layout(full_path), locale: locale).index! end end