-
Notifications
You must be signed in to change notification settings - Fork 12
Update images.md #1090
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Update images.md #1090
Conversation
Relates to elastic/docs-content#1079
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding a note about this behavior!
Added a suggestion on the wording, nothing wrong with relative paths they just can't extend beyond the toc.yml
subtree.
docs/syntax/images.md
Outdated
|
||
Images can be referenced from the top-level `_static` dir or a local image dir. | ||
:::{note} | ||
If you reference an image using a relative path, it must be relative to the `toc.yml` or `docset.yml` rather than relative to the page that uses it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It can be a relative path but it can not go relative beyond the toc.
e.g
/images/
- other.png
/solutions/
/images/
- observability-apm-app-landing.png`
/page/
- index.md
toc.yml
../images/observability-apm-app-landing.png
from index.md
is fine because that lives in the same subtree as the toc.yml
the page lives in.
../../images/other.png
lives outside the toc.yml
subtree so is at risk of being broken if the assembler rehomes this subtree.
`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, i've taken another go at the explanation since i think this might confuse folks
|
||
Images can be referenced from the top-level `_static` dir or a local image dir. | ||
If a page uses an image that exists outside the folder that contains the `toc.yml` file or `docset.yml` file that contains that page, the image will fail to render and will generate warnings. Likewise, if a snippet in a [file inclusion](/syntax/file_inclusion.md) includes an image and is used in pages that exist in different `toc.yml`, the images will break. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and is used in pages that exist in different
toc.yml
, the images will break...
Unless the images is copied into all the folders where the re-use occurs in exactly the same relative folder structure?
Relates to elastic/docs-content#1079
The image guidelines seem to imply that we can use relative image paths but they seem problematic when you go from a local build to a fully assembled build. This PR therefore recommends using absolute paths.