[Docs] Broken link in Kubernetes doc
Author: dmsuehir
Pull request: no
Labels: name: Good First Documentation Issue

### System Info

N/A

### Who can help?

@stevhliu 

### Information

- [ ] The official example scripts
- [ ] My own modified scripts

### Tasks

- [ ] An officially supported task in the `examples` folder (such as GLUE/SQuAD, ...)
- [ ] My own task or dataset (give details below)

### Reproduction

I recently helped add kubernetes instructions to the documentation [here](https://github.com/huggingface/transformers/blob/main/docs/source/en/perf_train_cpu_many.md#usage-with-kubernetes), and I saw that with the recent patch, it's now posted at the huggingface.co docs site [here](https://huggingface.co/docs/transformers/perf_train_cpu_many#usage-with-kubernetes). However, at the docs site, it seems like links to non-Hugging Face pages are broken. For example, in the first sentence under the heading when it links "Kubeflow PyTorchJob training operator", that link doesn't work for me. What's also weird is that the link *does* work if I right click it and open it in a new tab, but regular click gives me a 404. The links also work fine from the GitHub.
 

### Expected behavior

Links should work as they do in GitHub from the .md

Comments:
Thanks for reporting! It seems like the links don't work for Safari, but they're ok with the Arc/Chrome browsers. It seems like the link is being changed somehow from kubeflow to huggingface which is why it is giving the 404:

```diff
- https://www.kubeflow.org/docs/components/training/pytorch
+ https://huggingface.co/docs/components/training/pytorch
```

I'll check with the frontend team and see what's wrong 🙂 

@stevhliu Just checking in - is there any update on this?

cc @mishig25, any updates on this issue?

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the [contributing guidelines](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md) are likely to be ignored.

This still seems to be an issue.

Gentle ping @mishig25 

Another ping @mishig25 

Another ping @mishig25 

Hello, I am new to contributing to open source projects. I have found that while using safari browser I get a straight 404 error, but while on a chrome browser the links works as intended half of the time. 
I can confirm that I see the same redirect that @stevhliu mentioned ;

https://www.kubeflow.org/docs/started/installing-kubeflow/ (working page)
redirects to 
https://huggingface.co/docs/started/installing-kubeflow (404 Error page)

At this point, I’m not sure how to fix this issue myself, but I wanted to share what I’ve discovered in the hope that it will be helpful. Please let me know if there’s a direction I can take or if I’m missing anything. I appreciate your guidance!

Hi @saldanhad - great - thanks for tackling this issue as one of your first contributions! To get the doc preview, the run has to be approved by a HF team member. I've done this on the PR, so you should be able to see the preview. I'm going to be off, so the best person to ping for review when ready is `@stevhliu`

Hi @amyeroberts, Thanks for your help and advise on this, will get in touch with concerned once ready.

Hi @stevhliu,

I’ve noticed that when certain links (such as those to the Kubeflow documentation) are rendered on the docs site, there seems to be an internal change in the URL, causing them to redirect incorrectly. Unfortunately, I haven’t been able to identify the issue in the build logs or find a clear explanation for this behavior.

As a temporary workaround, though not ideal, would it be acceptable to include a note in the .md files instructing users to 
`(Right-click + 'open in  new tab')` until we can resolve the root cause?
Please let me know if you’d prefer another approach, or if there are additional logs or configurations I could check to help debug this further. This is in reference to the work done in [PR #33879].

Alternately, I am not completely sure but do you think mapping `broken HF` links to the `kubeflow` links under `_redirects.yml` might work here? 

Thanks for your help!

was this fixed in #33879 ?

The external links work, but the documentation site breaks because of the link redirect issue. So, you have to open the external links in a separate tab to avoid breaking the documentation site.

> Alternately, I am not completely sure but do you think mapping broken HF links to the kubeflow links under _redirects.yml might work here?

As far as I know, the `_redirect.yml` is for mapping renamed files, and I don't know if it'll work for links on a page. Feel free to give it a try, though, if you're up for it! 🙂 

> As far as I know, the _redirect.yml is for mapping renamed files, and I don't know if it'll work for links on a page. Feel free to give it a try, though, if you're up for it! 🙂
 
 Hi @stevhliu,

I appreciate your insights about the _redirect.yml file, which you mentioned is for mapping renamed files. However, I'm curious if it can also handle links within a page. Could you provide more information about _redirect.yml or any related configuration files that could help me resolve this issue?

I've reviewed the comments and checked the link [here](https://huggingface.co/docs/components/training/pytorch), but I couldn't find it in the documentation or the codebase.

It seems that changes to _redirect.yml might not address the problem since it primarily deals with files. Any guidance or additional resources you could share would be greatly appreciated!

Thank you!


This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the [contributing guidelines](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md) are likely to be ignored.