diff --git a/py/docs/templates/config.mako b/py/docs/templates/config.mako
index c7fa88da81..34eafd8ba9 100644
--- a/py/docs/templates/config.mako
+++ b/py/docs/templates/config.mako
@@ -28,7 +28,7 @@
# A prefix to use for every HTML hyperlink in the generated documentation.
# No prefix results in all links being relative.
- link_prefix = ''
+ link_prefix = 'docs/api/'
# Enable syntax highlighting for code/source blocks by including Highlight.js
syntax_highlighting = False
diff --git a/py/docs/templates/text.mako b/py/docs/templates/text.mako
index 40d25163be..a0025cfee4 100644
--- a/py/docs/templates/text.mako
+++ b/py/docs/templates/text.mako
@@ -9,10 +9,9 @@
name = name or dobj.qualname + ('()' if isinstance(dobj, pdoc.Function) else '')
if isinstance(dobj, pdoc.External) and not external_links:
return name
- url = dobj.url(relative_to=module, link_prefix=link_prefix,
- top_ancestor=not show_inherited_members).replace('.html','')
+ url = dobj.url(link_prefix=link_prefix, top_ancestor=not show_inherited_members).replace('.html','')
## Replace "." with "_" because Docusarus doesn't seem to like "." in custom heading ids.
- return f'{name}'
+ return f'{name}'
def to_html(text):