How do i describe a dir path for loading pngs? #277
-
|
I am trying to use this plugin so I can use variables instead of typing relative or absolute path for PNG files under extra:
app_images: /assets/images/applications/I did above in INFO - Doc file 'wiki/Docker/compose/applications/syncthing.md' contains an absolute link '/assets/images/applications/syncthing.png', it was left as is. Did you mean '../../../../assets/images/applications/syncthing.png'?How to do this correctly? |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 6 replies
-
|
Welcome to this project and thank you! |
Beta Was this translation helpful? Give feedback.
-
|
A '/' at the start of a path denotes a path relative to the root of your server, and it will likely not work. Remove the initial '/' to get a path relative to your |
Beta Was this translation helpful? Give feedback.
-
|
Sorry, you were not using the And the hyperlink feature is relative to the I don't know any solution that would be elegant and simple... except changing the directory structure of your project (but I'm not sure you wish or can do that). |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
|
Solved it! After searching the internet, I decided to search mkdocs documentation and found a solution. Below seems to be working for my use case. mkdocs.yml: plugins:
- search
- macros:
on_undefined: strict
validation:
links:
absolute_links: relative_to_docs
extra:
app_images: '/assets/images/applications/' MD file: Now it loads and there are no warning messages with relative paths showing inside logs. |
Beta Was this translation helpful? Give feedback.

Solved it!
After searching the internet, I decided to search mkdocs documentation and found a solution. Below seems to be working for my use case.
mkdocs.yml:
MD file:
Now it loads and there are no warning messages with relative paths showing inside logs.