Replies: 1 comment 1 reply
-
I wouldn't consider it a bug per se. Snippets is not written for MkDocs, but for Python Markdown, but is often used in MkDocs (I use it in MkDocs). MkDocs has knowledge of the location of each file it is evaluating, so it also can evaluate files relative to that page, which is why requires links to be relative to the current page. Python Markdown has no knowledge of the current file under evaluation, and that information is never passed to it. So, if you are using a link in a snippet that needs to be context aware (more specifically, know the file path relative to the current page under evaluation), then Snippets will likely have issues as that information is not provided to Snippets. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Faced with the problem of using links in snippets. For example:
I have a snippet file empty_spaces.md, that has a link like
[settings](/docs/web-portal/settings/wp_settings/)
, then when including this snippet into the/docs/glossary.md
file, the browser tries to go to/docs/glossary/[settings](/docs/ru/web-portal/settings/wp_settings/)
. I've gone through all the documentation on snippets and material for mkdocs, but I haven't found a solution to this problem. Perhaps this is some kind of well-known bug?Beta Was this translation helpful? Give feedback.
All reactions