Introduce option to preview from subdirectory - Python mkdocs
Relative paths to assets and links behave differently at the root of a domain compared to sub-directories. Notably, relative paths backward from the root always resolve to the root, whereas relative paths backward from subdirectories adhere to the directory structure.
When docs are built and published to a subdirectory, this quirk will mean that the preview experience created by
mkdocs serve will differ from what is actually published.
|-- docs | |-- images | | `-- example.png | `-- index.md `-- mkdocs.yml
# index.md Both images are rendered when using `mkdocs serve`, but only the bottom image is rendered if built/published to a subdirectory/subfolder: ![should not render](../images/example.png) ![should render](./images/example.png) mkdocs serve -> http://localhost:8000/../images/example.png published -> http://example.com/all-docs/my-doc/../images/example.png
Possible Ways to Support
- Maybe interpret and leverage the
site_dirconfiguration option as part of the preview (so that instead of
http://localhost:8000/the preview would be available at
- Or add an explicit
preview_dirconfiguration to the
servecommand to achieve the same?
I'm assuming you have not set the
site_url config option. If that setting includes a subdir (
https://example.com/subdir/) then the local server will alter its behavior to account for it. The site is still served from
http://localhost/ but other adjustments are made to ensure links make sense, etc.
https://github.com/mkdocs/mkdocs/pull/2424 implemented the suggested way to alleviate this.
- What type should be used for air conditioners? - smart-home-nodejs
- "Zoom to selection" doesn't work properly on "Weekly death growth rate vs. daily death rate" - TypeScript owid-grapher
- Add ETW tracing in ebpf UM components. - ebpf-for-windows C
- Address the use of italics in the Product Content guidelines - polaris-react
- bokeh Changelog process / policies - Python
- add configuration for maven-plugin to exclude provided scope dep. - Java spring-boot
- tensorflow XLA does not know associative law - Cplusplus
- BepInEx Mod fails to load with "Failed to extract and install BepInEx - retrying later" - Shell valheim-server-docker