diff options
author | Takuya Noguchi <takninnovationresearch@gmail.com> | 2022-02-14 19:45:56 +0300 |
---|---|---|
committer | Achilleas Pipinellis <axil@gitlab.com> | 2022-02-14 19:45:56 +0300 |
commit | 734e54644ecfc4f1fe013eefb8471b7c64b36b24 (patch) | |
tree | 3efe813517a282f6fcae4261f577183c95ea8b2a /layouts/partials | |
parent | 18aeeabd0a33882ea0238448488278c214c0a1ca (diff) |
Use the canonical URLs as links anywhere
Diffstat (limited to 'layouts/partials')
-rw-r--r-- | layouts/partials/versions_list.html | 7 |
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 %> |