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(guide): simplify url routes #4301

Merged
merged 1 commit into from
May 6, 2024
Merged

Conversation

conorsch
Copy link
Contributor

@conorsch conorsch commented May 1, 2024

Describe your changes

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.

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/ci-only, no code changes

Testing

In order to aid in review, I've deployed this new config from the CLI, so it's live right now. Of particular importance is ensuring that historical URLs published in various places like the README and Discord are still working. Some examples to the old-style URLs:

All of those should get redirected to the correct locations in the docs, without the /main/ prefix.

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.
Copy link
Member

@hdevalence hdevalence left a comment

Choose a reason for hiding this comment

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

The original rationale was to be able to generate copies of the docs for each version. But we never did this, and it's probably confusing to have multiple (outdated) versions of the guide.

@hdevalence hdevalence merged commit 7854a5f into main May 6, 2024
13 checks passed
@hdevalence hdevalence deleted the docs-simpler-urls-in-guide branch May 6, 2024 19:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants