Merge pull request #1465 from thomasritz/fix-wrong-parent

Fixes computation of `parent`.
This commit is contained in:
Thomas Reynolds 2015-02-23 14:18:31 -07:00
commit fbe71f51e4
2 changed files with 3 additions and 1 deletions

View file

@ -9,7 +9,9 @@ module Middleman
tail = parts.pop
is_index = (tail == app.index_file)
return nil if is_index && parts.length < 1
if parts.empty?
return is_index ? nil : store.find_resource_by_path(app.index_file)
end
test_expr = parts.join('\\/')
# A makeshift for eponymous reverse-lookup