Skip to content

Conversation

@NicolasPllr1
Copy link

@NicolasPllr1 NicolasPllr1 commented Nov 16, 2025

Problem (docs)

I found broken 'Learn about Gateway' links in code blocks (e.g. here) reading the docs, which led me to try and fix them!

I think the problem is in the transform_gateway_code_block function. It tries to compute a relative path to the Gateway page using the parent of the current page (relative_path_root ) instead of the page itself:

docs_path = DOCS_ROOT / 'gateway'
relative_path = docs_path.relative_to(relative_path_root, walk_up=True)
link = f"<a href='{relative_path}' style='float: right;'>Learn about Gateway</a>"

This is the logic I tried to fix. I tested a few links locally and they seem to be working now ; )

Hope this is enough and helps!


Couple of tests:

  • In 'Pydantic AI' : link (was already working)
  • In 'Core Concepts > Agent' : link (was broken)
  • In 'Models and Providers > OpenAI' : link (was broken)

Related Issue

@NicolasPllr1 NicolasPllr1 marked this pull request as ready for review November 16, 2025 11:59
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.

1 participant