Closed
Description
Describe the bug
I'm not sure if this is a bug or not, but when using absolute links to reference images in the style of absolute links used for internal links, the final URL that ends up in the HTML doesn't take the path_prefix
into consideration.
Also, the plain Markdown syntax for images seems to behave differently than the custom directive (:::{image}
).
I tried three different URL formats with both the plain Markdown syntax and the custom directive: relative links, absolute links based on file path, and absolute links based on the final URL path. Here are the results:
Relative link
Syntax
<!-- Plain markdown -->

<!-- Custom directive -->
:::{image} images/settings-read-only-badge.png
:alt: Buildkite pipeline view showing a few test failures
:::
Rendered result

Logs
No warnings/errors.
Absolute link (file-based)
Syntax
<!-- Plain markdown -->

<!-- Custom directive -->
:::{image} /reference/images/settings-read-only-badge.png
:alt: Buildkite pipeline view showing a few test failures
:::
Rendered result

Logs
No warnings/errors.
Absolute link (url-based)
Syntax
<!-- Plain markdown -->

<!-- Custom directive -->
:::{image} /reference/kibana/images/settings-read-only-badge.png
:alt: Buildkite pipeline view showing a few test failures
:::
Rendered result

Logs
Error: `/reference/kibana/images/settings-read-only-badge.png` does not exist. resolved to `/GitHub/docs-builder/.artifacts/checkouts/next/kibana/docs/reference/kibana/images/settings-read-only-badge.png
┌─[/GitHub/docs-builder/.artifacts/checkouts/next/kibana/docs/reference/index.md]
│
│
└─
Error: `/reference/kibana/images/settings-read-only-badge.png` does not exist. resolved to `/GitHub/docs-builder/.artifacts/checkouts/next/kibana/docs/reference/kibana/images/settings-read-only-badge.png
┌─[/GitHub/docs-builder/.artifacts/checkouts/next/kibana/docs/reference/index.md]
│
38 │ 
· ─────────────────────────────────────────────────────
·
│
└─
Expected behavior
I would expect:
- Plain Markdown and custom directive to behave the same with regard to image links.
- To be able to use the same pattern used for internal absolute links for image links.
Steps to reproduce
- Build docs-builder and docs-assembler locally.
- Clone all repos.
- Manually edit
.artifacts/checkouts/next/kibana/docs/reference/index.md
to add:## Relative link  :::{image} images/settings-read-only-badge.png :alt: Buildkite pipeline view showing a few test failures ::: ## Absolute link (file-based)  :::{image} /reference/images/settings-read-only-badge.png :alt: Buildkite pipeline view showing a few test failures ::: ## Absolute link (url-based)  :::{image} /reference/kibana/images/settings-read-only-badge.png :alt: Buildkite pipeline view showing a few test failures :::
- Build all.
- Run the site locally and open in a browser.
Tooling
- docs-builder
- migration tooling
- I'm not sure