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

docs: add a few redirects #4232

Merged
merged 1 commit into from
Apr 17, 2024
Merged

docs: add a few redirects #4232

merged 1 commit into from
Apr 17, 2024

Conversation

conorsch
Copy link
Contributor

Describe your changes

Follow-up to #4215, in which we reorganized the guide for readability. Some of the existing content got shuffled into subroutes, and already one person in Discord has pointed out that we broken URLs. Tacking on some http redirects via mdbook [0].

[0] https://rust-lang.github.io/mdBook/format/configuration/renderers.html#outputhtmlredirect

Issue ticket number and link

Checklist before requesting a review

  • If this code contains consensus-breaking changes, I have added the "consensus-breaking" label. Otherwise, I declare my belief that there are not consensus-breaking changes, for the following reason:

    docs-only, no code changes.

Follow-up to #4215, in which we reorganized the guide for readability.
Some of the existing content got shuffled into subroutes, and already
one person in Discord has pointed out that we broken URLs. Tacking on
some http redirects via mdbook [0].

[0] https://rust-lang.github.io/mdBook/format/configuration/renderers.html#outputhtmlredirect
@conorsch conorsch merged commit 5faa43e into main Apr 17, 2024
8 checks passed
@conorsch conorsch deleted the docs-redir branch April 17, 2024 23:47
@conorsch
Copy link
Contributor Author

This didn't work as well as I'd hoped: the mdbook settings are html-level redirects, so they display a warning in Firefox. Worse, the redirects conflict with the / -> /main/index.html redirect specified in the Firebase config. Going to follow up on this in #3417.

conorsch added a commit that referenced this pull request May 1, 2024
Modifies the firebase hosting config to remove the `/<version>/`
prefix from the guide URLs, which has only ever been `/main/`, due to #6.
Also includes rewrites so that historical URLs with the `/main/` prefix
will still be honored, and redirected to the appropriate location that's
live in the docs.

Squirreling away this one-liner for generating a "sitemap" of all URLs:

    curl -s http://localhost:5000 \
        | rg -i 'class="chapter"' \
        | perl -npE 's/href=/\nhref=/g ' \
        | perl -nE  '/href="([\w.\/]+)"/g and say $1' > sitemap.txt

which was helpful in creating the redirects.

Removes the mdboook-only meta-refresh redirects added in #4232,
because the browser UX was atrocious. Refs #3417.
@conorsch conorsch mentioned this pull request May 1, 2024
1 task
hdevalence pushed a commit that referenced this pull request May 6, 2024
Modifies the firebase hosting config to remove the `/<version>/`
prefix from the guide URLs, which has only ever been `/main/`, due to #6.
Also includes rewrites so that historical URLs with the `/main/` prefix
will still be honored, and redirected to the appropriate location that's
live in the docs.

Squirreling away this one-liner for generating a "sitemap" of all URLs:

    curl -s http://localhost:5000 \
        | rg -i 'class="chapter"' \
        | perl -npE 's/href=/\nhref=/g ' \
        | perl -nE  '/href="([\w.\/]+)"/g and say $1' > sitemap.txt

which was helpful in creating the redirects.

Removes the mdboook-only meta-refresh redirects added in #4232,
because the browser UX was atrocious. Refs #3417.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants