You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
MkDocs assumes absolute paths start from the root of the hosted website, like https://localhost/. For example, an absolute path like /assets/image1.jpg becomes https://localhost/assets/image1.jpg, which is correct if MkDocs is hosted at the root.
When the server root is not the same as the MkDocs root, this plugin lets you define a webcontext to prepend to these absolute paths. The webcontext path (e.g., /projectname/documents) replaces the default root (/).
Features
Converts absolute image paths in Markdown to be relative to a specified web context.
Converts image src attributes in HTML embedded in Markdown.
These paths will be rewritten to start with your defined context.
CSS Support
After your site is built, the plugin will scan all .css files in the output directory and rewrite any url("/...") references to use the defined context.
Logging
Rewrites are logged at the DEBUG level. Updated CSS files are logged at the INFO level.
Special Thanks
This plugin was inspired by and built with guidance from: