Minor performance fix to not double-compute metadata in directory_indexes.
This commit is contained in:
parent
044b49d83b
commit
14a39e5e87
|
@ -36,15 +36,15 @@ Feature: link_to helper
|
|||
And a file named "source/link_to.html.erb" with:
|
||||
"""
|
||||
<% menu_items.each do |item| %>
|
||||
<%= link_to(item.metadata[:page]['title'], item.url) %>
|
||||
<%= link_to(item.metadata[:page]['title'], item) %>
|
||||
<%= link_to(item.data['title'], item.url) %>
|
||||
<%= link_to(item.data['title'], item) %>
|
||||
<% end %>
|
||||
"""
|
||||
And a file named "source/link_to/sub.html.erb" with:
|
||||
"""
|
||||
<% menu_items.each do |item| %>
|
||||
<%= link_to(item.metadata[:page]['title'], item.url) %>
|
||||
<%= link_to(item.metadata[:page]['title'], item) %>
|
||||
<%= link_to(item.data['title'], item.url) %>
|
||||
<%= link_to(item.data['title'], item) %>
|
||||
<% end %>
|
||||
"""
|
||||
And the Server is running at "indexable-app"
|
||||
|
|
|
@ -40,13 +40,10 @@ module Middleman
|
|||
File.extname(index_file) != resource.ext
|
||||
|
||||
# Check if frontmatter turns directory_index off
|
||||
d = resource.raw_data
|
||||
next if d && d[:directory_index] == false
|
||||
next if resource.data[:directory_index] == false
|
||||
|
||||
# Check if file metadata (options set by "page" in config.rb) turns directory_index off
|
||||
if resource.metadata[:options] && resource.metadata[:options][:directory_index] == false
|
||||
next
|
||||
end
|
||||
next if resource.metadata[:options][:directory_index] == false
|
||||
|
||||
resource.destination_path = resource.destination_path.chomp(File.extname(index_file)) + new_index_path
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue