diff options
author | Achilleas Pipinellis <axil@gitlab.com> | 2018-03-19 19:25:37 +0300 |
---|---|---|
committer | Achilleas Pipinellis <axil@gitlab.com> | 2018-03-19 19:25:37 +0300 |
commit | 9ccc6234db3aad99e96845033b1544862fca642e (patch) | |
tree | babf57b61bc2a6f056fc702eb77764b2efa6f445 /layouts/head.html | |
parent | c45d65f0210bc74b8691cd942c69b84a5fba8ef7 (diff) |
Fix head and move canonical URLs to own layout
Diffstat (limited to 'layouts/head.html')
-rw-r--r-- | layouts/head.html | 34 |
1 files changed, 1 insertions, 33 deletions
diff --git a/layouts/head.html b/layouts/head.html index 6211623a..c94993da 100644 --- a/layouts/head.html +++ b/layouts/head.html @@ -5,39 +5,7 @@ <% else %> <meta name="description" content="Documentation for GitLab Community Edition, GitLab Enterprise Edition, Omnibus GitLab, and GitLab Runner."> <% end %> -<% if false %> -This is a comment! -Implement canonical links https://gitlab.com/gitlab-com/gitlab-docs/issues/167 -We want to: -- All index.html and README.html files stripped -- Replace ce/ with ee/ ------------------- -if the link ends with README.md or index.md - if the link starts with ce - replace it with ee and strip README.md or index.md - if the link doesn't start with ce - strip README.md or index.md -if the link doesn't end with README.md or index.md - if the link starts with ce - replace it with ee - if the link doesn't start with ce - use its initial path -<% end %> -<% if ENV['NANOC_ENV'] == 'production' %> - <% if (@item.identifier =~ /(index|README)\.md$/) == 0 %> - <% if @item.identifier.to_s.split('/')[1] == 'ce' %> - <link rel="canonical" href="<%= @config[:base_url] %>/ee/<%= @item.identifier.to_s.split('/')[2..-2].join('/') %><% unless @item.identifier.to_s.split('/')[2..-2].join('/').length == 0 %>/<% end %>" /> - <% else %> - <link rel="canonical" href="<%= @config[:base_url] %><%= @item.identifier.to_s.split('/')[0..-2].join('/') %>/" /> - <% end %> - <% else %> - <% if @item.identifier.to_s.split('/')[1] == 'ce' %> - <link rel="canonical" href="<%= @config[:base_url] %>/ee/<%= @item.identifier.without_ext.to_s.split('/')[2..-1].join('/') + '.html' %>" /> - <% else %> - <link rel="canonical" href="<%= @config[:base_url] %><%= @item.identifier.without_ext + '.html' %>" /> - <% end %> - <% end %> -<% end %> +<%= render '/canonical_urls.*' %> <link rel="stylesheet" href="<%= @items['/assets/stylesheets/bootstrap.min.*'].path %>"> <link rel="stylesheet" href="<%= @items['/assets/stylesheets/font-awesome.min.*'].path %>"> <link rel="stylesheet" href="<%= @items['/assets/stylesheets/stylesheet.*'].path %>"> |