Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-docs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorConnor Shea <connor.james.shea@gmail.com>2016-11-09 23:30:38 +0300
committerConnor Shea <connor.james.shea@gmail.com>2016-11-09 23:30:38 +0300
commit748f426799fc56b0ddb3cadc3145b3f33eef1b1d (patch)
tree7389a48400b385562d2274aaa8cb6bd3ab2fe8d2 /lib
parent90eb31ef28e004276787bf7435eee28634e30be3 (diff)
Fix the breadcrumbs helper to work with Runner.
Diffstat (limited to 'lib')
-rw-r--r--lib/helpers/child_parent_better.rb11
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/helpers/child_parent_better.rb b/lib/helpers/child_parent_better.rb
index 73894647..3ddd8386 100644
--- a/lib/helpers/child_parent_better.rb
+++ b/lib/helpers/child_parent_better.rb
@@ -28,18 +28,21 @@ module Nanoc::Helpers
puts item_identifier
end
- if (item_identifier.nil? || (item_identifier.to_s.end_with?('README.md') && item_identifier.to_s.split('/').length == 3))
+ if (item_identifier.nil? || (item_identifier.to_s.end_with?('README.md', 'index.md') && item_identifier.to_s.split('/').length == 3))
return
- elsif item_identifier.to_s.end_with?('README.md')
+ elsif item_identifier.to_s.end_with?('README.md', 'index.md')
parent_dir = item_identifier.sub(/[^\/]+$/, '').chop
return get_nearest_parent(parent_dir)
else
parent_dir = item_identifier.sub(/[^\/]+$/, '').chop
parent = @items[parent_dir + '/README.*']
- if parent.nil?
+ alt_parent = @items[parent_dir + '/index.*']
+ if (parent.nil? && alt_parent.nil?)
get_nearest_parent(parent_dir)
- else
+ elsif alt_parent.nil?
return parent
+ else
+ return alt_parent
end
end
end