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 22:41:44 +0300
committerConnor Shea <connor.james.shea@gmail.com>2016-11-09 22:41:44 +0300
commit4e1f399eb8415fcdbade8577bc37bcfe15a561d4 (patch)
tree06b100c5fd9c7304b26442d8ecc30f0d94fab795 /lib
parent42c237332b6cc2fda006d7bac278a381a4a3c4a5 (diff)
Add some debugging code and 404 page. Fixes #25.
Diffstat (limited to 'lib')
-rw-r--r--lib/helpers/child_parent_better.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/helpers/child_parent_better.rb b/lib/helpers/child_parent_better.rb
index 351a6f24..73894647 100644
--- a/lib/helpers/child_parent_better.rb
+++ b/lib/helpers/child_parent_better.rb
@@ -2,6 +2,9 @@ module Nanoc::Helpers
module ChildParentBetter
# Returns an array of ancestor pages for the given page.
def ancestor_path_array(item)
+ if @config[:debug]
+ puts item
+ end
parent_array = Array.new
current_item = item
# Until the current item has no parent, keep running.
@@ -21,6 +24,10 @@ module Nanoc::Helpers
# A recursive function which returns the nearest parent item for the
# given path.
def get_nearest_parent(item_identifier)
+ if @config[:debug]
+ puts item_identifier
+ end
+
if (item_identifier.nil? || (item_identifier.to_s.end_with?('README.md') && item_identifier.to_s.split('/').length == 3))
return
elsif item_identifier.to_s.end_with?('README.md')