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

Add canonical URL for rustdoc pages #1773

Merged
merged 1 commit into from
Jul 20, 2022
Merged

Conversation

jsha
Copy link
Contributor

@jsha jsha commented Jul 19, 2022

Omit the link for crates that specify their own documentation URL.

Part of #74 and #1438

@github-actions github-actions bot added the S-waiting-on-review Status: This pull request has been implemented and needs to be reviewed label Jul 19, 2022
Copy link
Member

@jyn514 jyn514 left a comment

Choose a reason for hiding this comment

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

This looks good to me, but can we add some tests to make sure it works properly?

@syphar
Copy link
Member

syphar commented Jul 19, 2022

@jsha in general: thank you for pushing this forward!

@syphar
Copy link
Member

syphar commented Jul 19, 2022

@jsha I assume the second part of #74 (comment) will be in a second PR? So no-index for pages which provide a documentation url?

@jsha
Copy link
Contributor Author

jsha commented Jul 19, 2022

I assume the second part of #74 (comment) will be in a second PR? So no-index for pages which provide a documentation url?

Yes, that's correct. That part is a little trickier - I'll update on #74.

@jsha jsha force-pushed the canonical-url branch 2 times, most recently from a66d19f to 3bd9ef0 Compare July 20, 2022 00:05
@jsha
Copy link
Contributor Author

jsha commented Jul 20, 2022

Pushed a new revision with a test. Writing a test helped me notice we were including index.html unnecessarily in the canonical URLs; I removed that.

Added a comment describing why it's fine that the target might in some cases not exist.

Copy link
Member

@jyn514 jyn514 left a comment

Choose a reason for hiding this comment

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

Lgtm other than the nit. Thanks!

@jsha
Copy link
Contributor Author

jsha commented Jul 20, 2022 via email

@jyn514
Copy link
Member

jyn514 commented Jul 20, 2022

Hmm, Metadata is deserialized directly from Cargo.toml I think - if you rename it you'll also need to add a serde attribute so it still deserializes correctly.

Omit the link for crates that specify their own documentation URL.
@jyn514 jyn514 merged commit cccd8d9 into rust-lang:master Jul 20, 2022
@github-actions github-actions bot added S-waiting-on-deploy This PR is ready to be merged, but is waiting for an admin to have time to deploy it and removed S-waiting-on-review Status: This pull request has been implemented and needs to be reviewed labels Jul 20, 2022
@syphar syphar removed the S-waiting-on-deploy This PR is ready to be merged, but is waiting for an admin to have time to deploy it label Jul 24, 2022
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.

3 participants