Skip to content
This repository has been archived by the owner on Sep 30, 2020. It is now read-only.

Retaining the fragment identifier when redirecting #992

Merged

Conversation

davidalber
Copy link
Contributor

This PR changes the site redirect to propagate fragment identifiers when redirecting. For example, the US English conduct page contains a link to https://www.rust-lang.org/team.html#Moderation. If you navigate to that, the client-side redirect code will send you to a language-specific destination with #Moderation removed. A link followed on an instance of the site that has this change will have #Moderation after the redirect.

Note that #Moderation is not the correct anchor, so clicking on it will land you at the top of the Team Page. That is being corrected in #991.

Currently, if a user requests /team.html#foo and is redirected to
the sv-SE language, the new location will be /sv-SE/team.html.
This commit appends the fragment identifier to the redirection
target. Thus, if a user is requesting /team.html#foo and is
redirected to the sv-SE language, the new location will be
/sv-SE/team.html#foo.
kennytm added a commit to kennytm/rust that referenced this pull request Dec 23, 2017
…-link, r=kennytm

Fixing Rust Moderation Team link in Code of Conduct

The [Code of Conduct](https://github.com/rust-lang/rust/blob/master/CODE_OF_CONDUCT.md) has two broken links to the Rust Moderation Team.
- The current link is https://github.com/rust-lang/rust/blob/master/team.html#Moderation. That happened because the link is relative.
- The link in this PR is https://www.rust-lang.org/team.html#Moderation-team. Note: at the moment this is redirected client-side to a language-specific page and loses the fragment identifier. rust-lang/prev.rust-lang.org#992 aims to correct that.
kennytm added a commit to kennytm/rust that referenced this pull request Dec 23, 2017
…-link, r=kennytm

Fixing Rust Moderation Team link in Code of Conduct

The [Code of Conduct](https://github.com/rust-lang/rust/blob/master/CODE_OF_CONDUCT.md) has two broken links to the Rust Moderation Team.
- The current link is https://github.com/rust-lang/rust/blob/master/team.html#Moderation. That happened because the link is relative.
- The link in this PR is https://www.rust-lang.org/team.html#Moderation-team. Note: at the moment this is redirected client-side to a language-specific page and loses the fragment identifier. rust-lang/prev.rust-lang.org#992 aims to correct that.
kennytm added a commit to kennytm/rust that referenced this pull request Dec 26, 2017
…-link, r=kennytm

Fixing Rust Moderation Team link in Code of Conduct

The [Code of Conduct](https://github.com/rust-lang/rust/blob/master/CODE_OF_CONDUCT.md) has two broken links to the Rust Moderation Team.
- The current link is https://github.com/rust-lang/rust/blob/master/team.html#Moderation. That happened because the link is relative.
- The link in this PR is https://www.rust-lang.org/team.html#Moderation-team. Note: at the moment this is redirected client-side to a language-specific page and loses the fragment identifier. rust-lang/prev.rust-lang.org#992 aims to correct that.
@alexcrichton alexcrichton merged commit e5aa4eb into rust-lang:master Jan 4, 2018
@alexcrichton
Copy link
Member

Thanks!

@davidalber davidalber deleted the redirect-fragment-identifier branch January 4, 2018 16:31
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants