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:
authorAchilleas Pipinellis <axil@gitlab.com>2018-01-30 15:27:59 +0300
committerAchilleas Pipinellis <axil@gitlab.com>2018-02-07 17:19:44 +0300
commit550519c6ee931e3aa92a43f570a984bfde4b55b6 (patch)
tree1549f989bc3853c037b35ada122192d4ec0dc78b /layouts/header.html
parent03c9a426e5931ff240be0506539b0b2ca3e6fafe (diff)
Add logic to show CE when in development mode
When NANOC_ENV is set to production, the CE contents are hidden from the index page and the menu.
Diffstat (limited to 'layouts/header.html')
-rw-r--r--layouts/header.html26
1 files changed, 19 insertions, 7 deletions
diff --git a/layouts/header.html b/layouts/header.html
index 5999c420..1446ffef 100644
--- a/layouts/header.html
+++ b/layouts/header.html
@@ -7,13 +7,25 @@
<a class="nav-toggle" id="docs-nav-toggle">Menu</a>
<ul class="nav">
<li class="search"><input type="text" class="docsearch" placeholder="Search"></li>
- <% @config[:products].each do |name, product| %>
- <% if product[:expose] == true && Dir.exist?("#{@config[:content_dir]}/#{product[:slug]}")%>
- <li class="nav-item">
- <a href="<%= @items["/#{product[:slug]}/#{product[:index_file]}"].path %>">
- <%= product[:short_name] %>
- </a>
- </li>
+ <% if ENV['NANOC_ENV'] == 'production' %>
+ <% @config[:products].each do |name, product| %>
+ <% if product[:expose] == true %>
+ <li class="nav-item">
+ <a href="<%= @items["/#{product[:slug]}/#{product[:index_file]}"].path %>">
+ <%= product[:short_name] %>
+ </a>
+ </li>
+ <% end %>
+ <% end %>
+ <% else %>
+ <% @config[:products].each do |name, product| %>
+ <% if Dir.exist?("#{@config[:content_dir]}/#{product[:slug]}")%>
+ <li class="nav-item">
+ <a href="<%= @items["/#{product[:slug]}/#{product[:index_file]}"].path %>">
+ <%= product[:short_name] %>
+ </a>
+ </li>
+ <% end %>
<% end %>
<% end %>
</ul>