diff options
-rw-r--r-- | Rules | 6 | ||||
-rw-r--r-- | content/404.html | 5 | ||||
-rw-r--r-- | layouts/404.html | 23 | ||||
-rw-r--r-- | lib/helpers/child_parent_better.rb | 7 | ||||
-rw-r--r-- | nanoc.yaml | 3 |
5 files changed, 44 insertions, 0 deletions
@@ -24,6 +24,12 @@ preprocess do end end +compile '/404.*' do + filter :erb + layout '/404.*' + write '/404.html' +end + compile '/**/*.html' do layout '/default.*' end diff --git a/content/404.html b/content/404.html new file mode 100644 index 000000000..f54eb93ae --- /dev/null +++ b/content/404.html @@ -0,0 +1,5 @@ +--- +title: 404 Not Found +--- + +<h1>404 Not Found</h1> diff --git a/layouts/404.html b/layouts/404.html new file mode 100644 index 000000000..16810cc30 --- /dev/null +++ b/layouts/404.html @@ -0,0 +1,23 @@ +<!DOCTYPE HTML> +<html lang="en"> + <%= render '/head.*' %> + <body> + <div class="header"> + <a href="/"> + <img src="<%= @items['/assets/images/gitlab-logo.svg'].path %>"/> + <p>GitLab Documentation</p> + </a> + <ul> + <li><input type="text" class="st-default-search-input" placeholder="Search"></li> + <li><a href="<%= @items['/ce/README.*'].path %>">Community Edition</a></li> + <li><a href="<%= @items['/ee/README.*'].path %>">Enterprise Edition</a></li> + <li><a href="<%= @items['/omnibus/README.*'].path %>">Omnibus</a></li> + </ul> + </div> + <div class="main class"> + <%= yield %> + </div> + </body> + + <%= render '/analytics.*' %> +</html> diff --git a/lib/helpers/child_parent_better.rb b/lib/helpers/child_parent_better.rb index 351a6f244..738946472 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') diff --git a/nanoc.yaml b/nanoc.yaml index ee85d44b0..226393ec5 100644 --- a/nanoc.yaml +++ b/nanoc.yaml @@ -94,3 +94,6 @@ checks: # Whether or not breadcrumbs are enabled. # Breadcrumbs are enabled. breadcrumbs: true + +# Debug problems with the generation process by setting this config variable. +debug: false |