Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix book redirects #1884

Merged
merged 4 commits into from
Sep 26, 2024
Merged

Fix book redirects #1884

merged 4 commits into from
Sep 26, 2024

Conversation

dscho
Copy link
Member

@dscho dscho commented Sep 26, 2024

Changes

This makes the following URLs redirect to the respective book front pages:

Context

By mistake, I typed in one of those URLs and was surprised to be redirected to the 404 page. Easy fix.

@dscho dscho self-assigned this Sep 26, 2024
@dscho dscho marked this pull request as draft September 26, 2024 13:10
@dscho dscho force-pushed the book-redirects branch 2 times, most recently from cd4a670 to 5efd2fd Compare September 26, 2024 14:06
Instead of 404'ing, this URL should redirect to
https://git-scm.com/book/en/v2 automatically, similarly the
intermediate URL https://git-scm.com/book/en/.

Analogous redirects are also needed for the translated versions of the
book.

Signed-off-by: Johannes Schindelin <[email protected]>
I just fixed the `update-book2.rb` script so that URLs like
https://git-scm.com/book/ (with a trailing slash) redirect again; This
commit reflects the impact on the automatically rendered content files
in `external/book/`.

Signed-off-by: Johannes Schindelin <[email protected]>
There is already code to handle the top-level URL correctly. However,
URLs like http://localhost:5000/book/ still weren't handled by appending
`index.html`. Let's fix this.

This is needed because we are _just_ about to add tests to verify that
the book redirects at URLs like https://git-scm.com/book/ work.

Signed-off-by: Johannes Schindelin <[email protected]>
Now that `external/book/` has been re-generated, we can safely verify in
the CI builds that these redirects keep working.

Signed-off-by: Johannes Schindelin <[email protected]>
@dscho dscho marked this pull request as ready for review September 26, 2024 14:18
Copy link
Member

@ttaylorr ttaylorr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️ thanks for fixing!

@ttaylorr ttaylorr merged commit 8494c7f into git:gh-pages Sep 26, 2024
1 check passed
@dscho dscho deleted the book-redirects branch September 26, 2024 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants