MintPy icon indicating copy to clipboard operation
MintPy copied to clipboard

Broken links in website docs

Open jsta opened this issue 1 year ago • 3 comments

Description of the problem

I see the README has links like [mintpy.objects](../src/mintpy/objects). These work on Github but are broken on the docs site (https://mintpy.readthedocs.io/en/latest/). I think replacing these with absolute rather than relative links will fix them. I'm happy to submit a PR

jsta avatar Oct 10 '24 16:10 jsta

👋 Thanks for opening your first issue here! Please filled out the template with as much details as possible. We appreciate that you took the time to contribute! Make sure you read our contributing guidelines.

welcome[bot] avatar Oct 10 '24 16:10 welcome[bot]

Potential solution

The plan to solve the bug involves updating the relative links in the docs/README.md file to absolute links that correctly point to the corresponding pages on the documentation site hosted on Read the Docs. This change is necessary because the relative links, which work on GitHub, do not translate correctly to the documentation site, leading to broken links. By using absolute URLs, we ensure that the links are correctly resolved regardless of the context in which they are accessed.

What is causing this bug?

The bug is caused by the use of relative links in the docs/README.md file. These links are designed to work within the GitHub repository, where the file structure is consistent and predictable. However, when the documentation is built and hosted on Read the Docs, the file structure changes, and the relative links no longer point to the correct locations. This discrepancy results in broken links on the documentation site.

Code

To implement the solution, we need to replace each relative link in the docs/README.md file with an absolute link that points to the correct location on the documentation site. Here are the necessary changes:

1. `[Installation](https://mintpy.readthedocs.io/en/latest/installation.html)`
2. `[path to where the files are](https://mintpy.readthedocs.io/en/latest/dir_structure.html)`
3. `[Example](https://mintpy.readthedocs.io/en/latest/demo_dataset.html)`
4. `[Here](https://mintpy.readthedocs.io/en/latest/scripts/compare_velocity_with_diff_tropo.html)`
5. [`mintpy.objects`](https://mintpy.readthedocs.io/en/latest/src/mintpy/objects.html)
6. [`mintpy.utils`](https://mintpy.readthedocs.io/en/latest/src/mintpy/utils.html)
7. `[Quick start with example datasets](https://mintpy.readthedocs.io/en/latest/demo_dataset.html)`
8. `[Example data directory](https://mintpy.readthedocs.io/en/latest/dir_structure.html)`
9. `[Example template files](https://mintpy.readthedocs.io/en/latest/templates/README.html)`
10. `[contributing guide](https://mintpy.readthedocs.io/en/latest/CONTRIBUTING.html)`
11. `[default template file](https://mintpy.readthedocs.io/en/latest/src/mintpy/defaults/smallbaselineApp.cfg.html)`
12. `[reference file](https://mintpy.readthedocs.io/en/latest/references.html)`

How to replicate the bug

To replicate the bug, follow these steps:

  1. Visit the documentation site at https://mintpy.readthedocs.io/en/latest/.
  2. Navigate to the section where the README.md content is displayed.
  3. Click on any of the links listed in the README.md file.
  4. Observe that the links lead to 404 error pages or incorrect locations, indicating that they are broken.

By following these steps, you can confirm that the relative links do not work on the documentation site, highlighting the need for the proposed solution.

Click here to create a Pull Request with the proposed solution

Files used for this task:

Changes on docs/README.md

The issue reported is about broken links in the documentation site, which are currently using relative paths that work on GitHub but not on the documentation site hosted on Read the Docs. The task for this file is to replace these relative links with absolute links that point to the correct locations on the documentation site.

Analysis of the File

The docs/README.md file contains several relative links that need to be updated to absolute links to ensure they work correctly on the documentation site. Here are the relative links identified in the file:

  1. [Installation](./installation.md)
  2. [path to where the files are](dir_structure.md)
  3. [Example](./demo_dataset.md)
  4. [Here](../scripts/compare_velocity_with_diff_tropo.sh)
  5. mintpy.objects
  6. mintpy.utils
  7. [Quick start with example datasets](./demo_dataset.md)
  8. [Example data directory](./dir_structure.md)
  9. [Example template files](./templates/README.md)
  10. [contributing guide](./CONTRIBUTING.md)
  11. [default template file](../src/mintpy/defaults/smallbaselineApp.cfg)
  12. [reference file](./references.md)

Suggested Fix

To fix the broken links, these relative links should be replaced with absolute links that point to the correct locations on the documentation site. The absolute links should be constructed based on the structure of the documentation site. For example, if the documentation site is structured such that these files are located under specific sections or directories, the links should reflect that structure.

For instance, if the installation.md file is located at https://mintpy.readthedocs.io/en/latest/installation.html, the link should be updated to [Installation](https://mintpy.readthedocs.io/en/latest/installation.html).

Conclusion

The broken links in the docs/README.md file are due to the use of relative paths that do not translate correctly to the documentation site. By updating these links to absolute URLs that reflect the structure of the documentation site, the issue can be resolved.

Disclaimer: This comment was entirely generated using AI. Be aware that the information provided may be incorrect.

Current plan usage: 0.00%

Have feedback or need help? Discord Documentation [email protected]

codeautopilot[bot] avatar Oct 10 '24 16:10 codeautopilot[bot]

Thanks for noticing this issue, it seems to happen to all the relative links outside the docs directory. You are more than welcome to submit a PR and fix them. It would be even better if you could locate all the broken links in within the docs folders.

yunjunz avatar Oct 12 '24 14:10 yunjunz