Skip to content

Conversation

@severo
Copy link
Collaborator

@severo severo commented Aug 16, 2024

Found with

muffet --rate-limit 5 -i "https://huggingface.co/docs/hub/*" https://huggingface.co/docs/hub/

@severo severo requested a review from julien-c August 16, 2024 15:22
@HuggingFaceDocBuilderDev

It looks like you've updated documentation related to model or dataset cards in this PR.

Some content is duplicated among the following files. Please make sure that everything stays consistent.

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

Copy link
Member

@julien-c julien-c left a comment

Choose a reason for hiding this comment

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

let's wait for @mishig25 review though because i think those links used to work

@severo
Copy link
Collaborator Author

severo commented Aug 16, 2024

The detail:

@severo severo requested a review from mishig25 August 21, 2024 14:58
Copy link
Collaborator

@mishig25 mishig25 left a comment

Choose a reason for hiding this comment

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

@severo thanks a lot for finding this problem.

Explanation why this problem is occurring.

  1. We've used relative links such as [🤗 Datasets](../datasets/index) to switch from hub-docs page to another library's page.
  2. This relative path works fine when there is no {lang} or {branch} path present in the URL.

Example:
[🤗 Datasets](../datasets/index) was going to different paths depending whether {lang} was present or not:

  • /docs/hub/datasets-dask -> /docs/datasets/index (good)
  • /docs/hub/en/datasets-dask -> /docs/hub/datasets/index (bad)

To clarify, using relative links is not a problem when you are linking pages within a same library (since they will share same {lang} or {branch} prefixes). Using relative links is a problem when linking pages from different libraries. Therefore, we should always use absolute path /docs/{lib}/{page} when linking pages from different libraries.

@severo
Copy link
Collaborator Author

severo commented Aug 26, 2024

Done. I changed https://huggingface.co/docs for /docs (but only in the datasets doc pages... I let the rest of the docs untouched)

@pcuenca
Copy link
Member

pcuenca commented Aug 26, 2024

Thanks for the clarification @mishig25!

@severo severo merged commit 274783b into main Aug 26, 2024
@severo severo deleted the fix-links branch August 26, 2024 08:48
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.

6 participants