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

Create redirections #59

Closed
wants to merge 2 commits into from
Closed

Conversation

RomainMazB
Copy link
Contributor

Ok so here is how it works to fix #58

Step 1: redirect the users

Basically for those who will land on the old page referred by Google, the replacing page that I've created will be load, but the browser will redirect the user to the new page, due to the presence of this line:

<meta http-equiv="refresh" content="0;url=https://bevy-cheatbook.github.io/cheatsheet.html" />

Step 2: let the search engine know we moved the page

Because of this line, when the Google bot will come back to refresh the content of the cheatbook, we let him know that we moved the page:

<link rel="canonical" href="https://bevy-cheatbook.github.io/cheatsheet.html" />

Google will change the old page link to the canonical URL in its page index (or remove the bad link if the new page is already registered into its index).
In few days or weeks (totally random, it only depends on Google), the files I've created won't be needed anymore. To know that Google has registered the redirection.

I'll regularly make the verification and I'll make a PR to delete those files when they won't be needed anymore.


I don't use Jekyll so often so this may need a local test before running on production.
It won't break anything since it's related to pages that are not linked anymore into the cheatbook but it may need some fine tuning to make it work perfectly.

Also I'm not sure about the /cheatsheet/release.html redirecting to /cheatsheet.html > I understood that the old cheatsheet were "simplified" so maybe this page does not exists anymore.

Same for the /next/ page, not sure of what it actually were? /_next-steps.html page was the more accurate I've found.

@inodentry
Copy link
Contributor

For completeness, if you want to make sure you have covered all links, you can look at the old-0.4 branch. This points to the commit before PR #33 , which was the PR where I worked on the big 0.5 changes and where the reorganization happened.

I don't use Jekyll

This project uses mdbook, not Jekyll. mdbook is a simple Rust-centric static site generator specifically for rust programming books like this one.

Also I'm not sure about the /cheatsheet/release.html redirecting to /cheatsheet.html > I understood that the old cheatsheet were "simplified" so maybe this page does not exists anymore.

No. The old cheatsheet was just available in two versions: release and git. Git was removed. Now there is only one (equivalent to the old release), so there is no sense in having a subdirectory with multiple files.

Same for the /next/ page

No, that URL wasn't a page in the old book.

That's where the next branch of the repo is deployed. The intention is for it to be the URL where any temporary WIP stuff in preparation for the next bevy release can be published for people to see.

Although, maybe it would be nice to add a robots.txt or something to prevent it from being indexed by search engines altogether.

I'll regularly make the verification and I'll make a PR to delete those files when they won't be needed anymore.

Deleting the files should be as simple as reverting the commit. I use "squash and merge" when accepting PRs, so this PR would be a single commit, that can just be reverted.

@inodentry
Copy link
Contributor

@RomainMazB are you going to do anything more for this PR?

@inodentry
Copy link
Contributor

Is this still relevant? Should we close this?

@inodentry inodentry closed this May 18, 2021
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.

Broken link on second place in serp
2 participants