MkDocs file
mkdocs-macros-plugin automatically has access to everything in your mkdocs.yml file.
Example: Access your MkDocs configuration using config
mkdocs-macros-plugin comes with seven built-in objects. config contains the MkDocs configuration.
Code
Output
MkDocs Macros YAML Examples
Example: Add custom variables using extra
You can make custom variables available using the extra object in your mkdocs.yml.
Code
# In mkdocs.yml
extra:
extraValueOne: 1
extraValueTwo: two
# In your Markdown
* Value 1: {{ extraValueOne }}
* Value 2: {{ extraValueTwo }}
Output
- Value 1: 1
- Value 2: two