Open adamconnelly opened 2 months ago
This is caused because we emit the markdown files as-is without changing any of the links. This is especially a problem when files contain spaces (which we remove).
I believe we need to parse the markdown files and change the links (if relative) to point to the correct files. The frontend then needs to change the links to resolve according to the frontend routing.
I believe we should resolve this by parsing markdown on the backend and rewriting relative links to match the new URL structure and point to the actual target document. The frontend will have to change links pointing to markdown documents to match its own URL structure, as well as absolute links. We should also pay attention that links with anchors are preserved. This method will make it easier to use the API in other scenarios too.
I've noticed some slightly strange or broken behaviour when trying to use links on the aws_s3_bucket page.
The first problem is that all of the links seem to open a new tab, which is strange when you're navigating to something within the same page or inside the registry. You can see an example of this with the
aws_directory_bucket
link shown here:When you click on that link, it takes you to an error page instead of to the resource:
Another issue is that some links take you back to the HashiCorp registry instead of to the equivalent section in the OpenTofu registry. For example the
default_tags configuration block
takes you to the HashiCorp registry instead of to the correct anchor:Some links also seem to be slightly wrong, and take you to a page with a
.markdown
extension. For example this link toaws_s3_bucket_acl
:It takes you to a page like this: