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

Internal links point to page.html, but the true location is just page (Page Not Found) #279

Open
daviewales opened this issue Jan 16, 2025 · 4 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@daviewales
Copy link

Thank you for reporting an issue.

I think this is a broader issue, but for example, on the following page:
https://search.opentofu.org/provider/hashicorp/azurerm/latest/docs/resources/linux_virtual_machine

If I click any of the internal links (within the registry), I get page not found.
This is because the internal links point (for example) to:
https://search.opentofu.org/provider/hashicorp/azurerm/latest/docs/resources/virtual_machine.html

But the correct location is:
https://search.opentofu.org/provider/hashicorp/azurerm/latest/docs/resources/virtual_machine

This pattern is repeated across other links too.

There are also broken links for which the trick above doesn't work.
For example, the page above links to:
https://search.opentofu.org/docs/state/sensitive-data.html

But the correct location is:
https://opentofu.org/docs/language/state/sensitive-data/

OpenTofu Version

Not a CLI issue.

OpenTofu Configuration Files

Not a CLI configuration issue.

@daviewales daviewales added the bug Something isn't working label Jan 16, 2025
@abstractionfactory
Copy link
Collaborator

Hi @daviewales thank you for this issue, this is one of the problems we still need to solve as these links come from the original Markdown files created by HashiCorp.

@abstractionfactory abstractionfactory transferred this issue from opentofu/registry Jan 20, 2025
@abstractionfactory abstractionfactory added the help wanted Extra attention is needed label Jan 21, 2025
@abstractionfactory
Copy link
Collaborator

Hey folks, we would like to either implement this as the core team, or we are happy to accept a community contribution for this.

The way we would like to implement this is by creating a worker that converts the original links into links pointing to the correct markdown file in the API, and then the frontend should turn these links into the frontend's path understanding.

@daviewales
Copy link
Author

Looking at the markdown, there appear to be two types of links:

  • Relative links such as: virtual_machine.html. This already gets the correct path, and just needs to lose the .html suffix.
  • Absolute links such as: /docs/state/sensitive-data.html. This needs to map to https://opentofu.org/docs/language/state/sensitive-data/, which is slightly more complicated.

@abstractionfactory
Copy link
Collaborator

abstractionfactory commented Jan 22, 2025

@daviewales the situation is a bit more complicated. For example, a markdown document could have a relative link to /r/some_resource.md, which we need to map to the new storage scheme we use in our API. The source path schemes are documented here. The target schemes are in the API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants