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:
authorTakuya Noguchi <takninnovationresearch@gmail.com>2022-02-14 19:45:56 +0300
committerAchilleas Pipinellis <axil@gitlab.com>2022-02-14 19:45:56 +0300
commit734e54644ecfc4f1fe013eefb8471b7c64b36b24 (patch)
tree3efe813517a282f6fcae4261f577183c95ea8b2a /layouts
parent18aeeabd0a33882ea0238448488278c214c0a1ca (diff)
Use the canonical URLs as links anywhere
Diffstat (limited to 'layouts')
-rw-r--r--layouts/partials/versions_list.html7
1 files changed, 6 insertions, 1 deletions
diff --git a/layouts/partials/versions_list.html b/layouts/partials/versions_list.html
index d35023e7..dd563e01 100644
--- a/layouts/partials/versions_list.html
+++ b/layouts/partials/versions_list.html
@@ -10,7 +10,12 @@
<%= version %>
</a>
<% else %>
- <a class="dropdown-item" <%= active_dropdown(version) %> href='/<%= version %><%= @item.identifier.without_ext + '.html' %>'>
+ <!-- Use canonical URLs. If the URL contains 'index', remove it. -->
+ <% if @item.identifier.without_ext.split('/').last == 'index' %>
+ <a class="dropdown-item" <%= active_dropdown(version) %> href='/<%= version %><%= @item.identifier.without_ext.gsub('index', '') %>'>
+ <% else %>
+ <a class="dropdown-item" <%= active_dropdown(version) %> href='/<%= version %><%= @item.identifier.without_ext + '.html' %>'>
+ <% end %>
<%= version %>
</a>
<% end %>