announcement bar - relative link? #6881
-
Is it possible to use a link to a page in the same docs For example, if I have this in my {% extends "base.html" %}
{% block announce %}
<a href="path/to/page">Link</a>
{% endblock %} then the |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
Hello @VladimirFokow, mkdocs-material/src/templates/base.html Line 102 in 6b239db The |
Beta Was this translation helpful? Give feedback.
-
maybe this trick can be surfaced to the docs? |
Beta Was this translation helpful? Give feedback.
Hello @VladimirFokow,
should be possible, just like in the theme templates you can use the
url
filter to generate a relative link to the current page:mkdocs-material/src/templates/base.html
Line 102 in 6b239db
The
'assets/stylesheets/main.css'
is passed to theurl
filter and processed accordingly.https://github.com/mkdocs/mkdocs/blob/e755aaed7ea47348a60495ab364d5483ab90a4a6/mkdocs/utils/templates.py#L38
https://github.com/mkdocs/mkdocs/blob/e755aaed7ea47348a60495ab364d5483ab90a4a6/mkdocs/utils/__init__.py#L205