Skip to content

Commit

Permalink
Only add a canonical tag to the latest version of man pages
Browse files Browse the repository at this point in the history
The `/v2.6/man/` and `/v2.5/man/` urls actually serve different content,
so they should not all have the same canonical URL. Only make `/man/` the
canonical page of the latest version, `/v2.6/man/`.
  • Loading branch information
deivid-rodriguez committed Jan 7, 2025
1 parent 55e424d commit 50063c7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion source/layouts/two_column_layout.haml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
- is_command = command?(current_page.url) || whats_new?(current_page.url)
- v = current_page.url.scan(/v\d\.\d+/).first || current_version

- if /v\d\.\d+\//.match?(current_page.destination_path)
- if current_page.destination_path.start_with?(current_version)
- content_for(:canonical, commands_toplevel_path(current_page.destination_path))

~ wrap_layout :base do
Expand Down

0 comments on commit 50063c7

Please sign in to comment.