The file watcher knows which files exist, so don't use slow File.exists?
Possible solution for #903
This commit is contained in:
parent
fc37ef9b99
commit
c9d151ba66
3 changed files with 12 additions and 5 deletions
|
@ -59,9 +59,9 @@ module Middleman::CoreExtensions
|
|||
@cache[p] ||= begin
|
||||
in_file = frontmatter_and_content(p)
|
||||
|
||||
return in_file unless @app.files.exists?("#{path}.frontmatter")
|
||||
|
||||
external_file = frontmatter_and_content("#{p}.frontmatter")
|
||||
|
||||
return in_file if external_file.nil?
|
||||
|
||||
[
|
||||
external_file[0].deep_merge(in_file[0]),
|
||||
|
@ -145,8 +145,8 @@ module Middleman::CoreExtensions
|
|||
path
|
||||
end
|
||||
|
||||
return nil unless File.exists?(full_path)
|
||||
|
||||
return nil unless @app.files.exists?(full_path)
|
||||
|
||||
data = {}
|
||||
content = nil
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue