Skip to content

Commit 3957dcd

Browse files
committed
Fix path specification to use relative paths, not absolute
1 parent 5596fc2 commit 3957dcd

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

docs/contributing/documentation/myst-reference.md

+12-10
Original file line numberDiff line numberDiff line change
@@ -111,18 +111,22 @@ If you {ref}`enhance-media-label`, constrain the width of your media to 760 pixe
111111
If you don't enhance media, constrain the width of your media to 790 pixels.
112112

113113

114-
(static-assets-label)=
114+
(static-asset-paths-label)=
115115

116-
#### Static assets
116+
#### Static asset paths
117117

118118
When the documentation is in a submodule, paths to static assets—including, images, figures, and videos—must resolve in both the main documentation and the submodule's documentation.
119119

120-
Inside the `docs` directory, place static assets in the `/_static/` directory, and preferably inside a subdirectory named after the part or page of the documentation.
121-
For example, in the `volto` submodule, inside its `src/docs` directory, place an image at `/_static/user-manual/block-left-add-icon.png`.
122-
In your markup, use that same `docs`-root-relative path for the target, such as `/_static/user-manual/block-left-add-icon.png`.
123-
Don't use file-relative paths.
120+
Inside the {file}`docs` directory of either main documentation or the submodule, place static assets in the {file}`/_static/` directory, and preferably inside a subdirectory named after the part or page of the documentation.
124121

125-
Configuration in the {file}`conf.py` files for the main documentation and its submodules handle the resolution of `docs`-root-relative paths for you.
122+
For example, in the main documentation, place an image at {file}`docs/_static/contributing/git-commit-submodule.jpg`.
123+
Whereas, in the `volto` submodule, place an image inside it at {file}`src/docs/_static/user-manual/block-left-add-icon.png`.
124+
125+
If the static asset exists only in the main documentation and is referenced only from within the main documentation, then in your markup you should use a root-relative path for the media target, such as `/_static/contributing/git-commit-submodule.jpg`.
126+
127+
Otherwise, you should adjust your markup to use an appropriate relative path through the submodule.
128+
For example, to refer to a video from within the `volto` submodule, use `../_static/user-manual/blocks/block-copy-cut.mp4`.
129+
To refer to that same video from the main documentation, include the submodule's relative path `../../volto/_static/user-manual/blocks/block-copy-cut.mp4`.
126130

127131

128132
(enhance-media-label)=
@@ -241,9 +245,7 @@ If you include audio, it is helpful to include closed captions or a transcript.
241245
It is helpful to include overlays of key strokes, and mouse and other input gestures, to describe how to interact with the user interface.
242246

243247
Paths to videos must resolve in both the main documentation and the submodule's documentation, if present.
244-
Note that the path must be absolute to support both submodules and the main documentation.
245-
Don't use file-relative paths.
246-
See {ref}`static-assets-label` for details.
248+
See {ref}`static-asset-paths-label` for details.
247249

248250
Example MyST syntax is shown below.
249251

0 commit comments

Comments
 (0)