Skip to content
Discussion options

You must be logged in to vote

The repo_url is a predefined setting of the MkDocs configuration file. As far as I know, you cannot add more global key value pairs there without changing how it works. However, there is the extra key, which allows to add any keys under there.
Like so:

extra:
    pdf_url: http://xxxxxx/

and then in your Jinja2 HTML template you can do something like this:

<a href="{{ config.extra.pdf_url }}">Download the PDF</a>

or maybe you want to have access to those variables in the Markdown, then maybe the macros plugin can help you.

https://www.mkdocs.org/user-guide/configuration/#extra
https://mkdocs-macros-plugin.readthedocs.io/en/latest/

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@wanzhenchn
Comment options

Answer selected by squidfunk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants