Skip to content

Conversation

@NicolasPllr1
Copy link
Contributor

@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
@DouweM DouweM enabled auto-merge (squash) November 17, 2025 17:29
@DouweM
Copy link
Collaborator

DouweM commented Nov 17, 2025

@NicolasPllr1 Whoops, thanks a lot for the fix!

@DouweM DouweM merged commit 2981b17 into pydantic:main Nov 17, 2025
29 checks passed
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.

2 participants