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
diff options
context:
space:
mode:
-rw-r--r--Rules6
-rw-r--r--content/404.html5
-rw-r--r--layouts/404.html23
-rw-r--r--lib/helpers/child_parent_better.rb7
-rw-r--r--nanoc.yaml3
5 files changed, 44 insertions, 0 deletions
diff --git a/Rules b/Rules
index fc44fc923..59a9ecb04 100644
--- a/Rules
+++ b/Rules
@@ -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