Skip to content

Conversation

@davidhewitt
Copy link
Member

  • Set pages on https://pyo3.rs/main to advertise their canonical URL as themselves
  • Set old versions at https://pyo3.rs/vXYZ to noindex, even after netlify: try marking canonical URLs for all files #5761 they are being indexed by google
    • Latest version e.g. https://pyo3.rs/v0.28.0 advertises the canonical URL as https://pyo3.rs/latest
  • Set internal guide at https://pyo3.rs/internal to noindex

Comment on lines +673 to +679
# for internal docs, set noindex for all files
for file in glob("netlify_build/internal/**", recursive=True):
file_path = file.removeprefix("netlify_build")
url_path = _url_path_from_file_path(file_path)

for path in _url_and_file_paths(url_path, file_path):
headers_file.write(path + "\n X-Robots-Tag: noindex\n")
Copy link
Member Author

Choose a reason for hiding this comment

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

Can probably replace this with a single https://pyo3.rs/internal/* entry.


for path in _url_and_file_paths(url_path, file_path):
headers_file.write(
f'/v{version}/{path}\n Link: <https://pyo3.rs/latest/{url_path}>; rel="canonical"\n'
Copy link
Contributor

Choose a reason for hiding this comment

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

/latest redirects to /v{current_version}. Can it somehow confuse the search engines if we set /latest as the canonical URL?

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.

2 participants