-
It is easily possible to put absolute links in the copyright notice in the footer in My mkdocs-material-based documentation is a sub-section of some other website, so I used this method to add links for contacts, imprint and privacy which link to the dedicated pages of the "mother homepage". This worked fine. Now I wanted to have a separate, dedicated I tried to add a relative link like this:
Initially this seemed to work: clicking on the link takes me to However, this only works if the page where the footer is displayed is on "level 1" of the documentation. I have created a minimal working example that uses the following page layout:
If I click on the contact link on the page on "level 2", then I get a 404 error. I have tried to use Is there any way to make this work what I am trying to do? I have attached a minimal working example that shows the problem I am facing. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
As you noticed, it't not possible to use relative links at this point. What you can do is use theme extension, override the <!-- Copyright and theme information -->
<div class="md-copyright">
{% if config.copyright %}
<div class="md-copyright__highlight">
<a href="{{ 'contact' | url }}">➜ Contact</a>
</div>
{% endif %}
{% if not config.extra.generator == false %}
Made with
<a
href="https://squidfunk.github.io/mkdocs-material/"
target="_blank" rel="noopener"
>
Material for MkDocs
</a>
{% endif %}
</div> |
Beta Was this translation helpful? Give feedback.
As you noticed, it't not possible to use relative links at this point. What you can do is use theme extension, override the
copyright
partial and use theurl
filter to make the link relative. Something like: