A MkDocs plugin that injects the mkdocs.yml extra variables into the markdown template
usecase
As a user with variables that need to be inserted at the markdown level, not the template level.
I need a mkdocs plugin that will inject my `extras` variables into the markdown template before it gets rendered to html.
So that I can build my markdown pages with different values for images, urls, client_names, etc.
Note: This package requires MkDocs version 0.17 or higher.
Install the package with pip:
pip install mkdocs-markdownextradata-pluginEnable the plugin in your mkdocs.yml:
plugins:
- search
- markdownextradataNote: If you have no
pluginsentry in your config file yet, you'll likely also want to add thesearchplugin. MkDocs enables it by default if there is nopluginsentry set, but now you have to enable it explicitly.
More information about plugins in the MkDocs documentation
The variables you define in the mkdown.yml extra: slot will become available in your templates
extra:
customer:
name: Your name here
web: www.example.com
salt: salt.example.comand then in your *.md files
{{ customer.name }}
<a href="{{ customer.web }}">{{ customer.web }}</a>From reporting a bug to submitting a pull request: every contribution is appreciated and welcome. Report bugs, ask questions and request features using Github issues. If you want to contribute to the code of this project, please read the Contribution Guidelines.