hub: add base url to api paths (#22870)

<!--Delete sections as needed -->

## Description

Display the base url specifically for Hub API and Registry API docs. 

Is this enough, or do we also need to write something about it in the
description at the top?


![image](https://github.com/user-attachments/assets/666a4605-c131-4593-8a67-132481785a3e)


## Related issues or tickets

ENGDOCS-2748

## Reviews

<!-- Notes for reviewers here -->
<!-- List applicable reviews (optionally @tag reviewers) -->

- [ ] Editorial review

---------

Signed-off-by: Craig <craig.osterhout@docker.com>
This commit is contained in:
Craig Osterhout
2025-11-24 14:30:48 -08:00
committed by GitHub
parent a406224902
commit ac68e447ff

View File

@@ -50,7 +50,11 @@
<body>
{{ $specURL := urls.Parse (printf "/%s%s.yaml" .File.Dir .File.ContentBaseName) }}
<redoc spec-url="{{ $specURL.String }}" hide-hostname="true" suppress-warnings="true" lazy-rendering></redoc>
{{ if or (strings.HasPrefix .RelPermalink "/reference/api/hub/") (strings.HasPrefix .RelPermalink "/reference/api/registry/") }}
<redoc spec-url="{{ $specURL.String }}" suppress-warnings="true" lazy-rendering></redoc>
{{ else }}
<redoc spec-url="{{ $specURL.String }}" hide-hostname="true" suppress-warnings="true" lazy-rendering></redoc>
{{ end }}
<script src="https://cdn.redoc.ly/redoc/latest/bundles/redoc.standalone.js"></script>
</body>