Is it possible to add variable substitution in markdown files? #6922
-
I am transitioning from hugo to mkdocs and as part of my process I use some reflection to generate docs from my configuration. During this process I also want to have a link to the source code for that config value and that requires me to know the current version of the application. My previous strategy was to use a hugo shortcode which has access to the sites params ( example I tried to replicate this feature by building the same markdown like syntax in the meta object of the mkdocs.yml file but as you would imagine by my post here that does not seem to be substituted during the build. Here is the relevant part of the config. # mkdocs.yml
meta:
# I believe version is used by the versioning
# plugin so I used a different key here
current_version: v1.2.3 Here is what I tried to do in my config markdown file <!-- page markdown -->
.../changie/blob/{{ config.extra.current_version }}/... End goal, replace the current version with the value from the mkdocs.yml .../changie/blob/v1.2.3/... The only idea I have left is some how creating a custom template? Its not really a page template though its like for every value sort of thing? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
I think the macros plugin is what you're looking for |
Beta Was this translation helpful? Give feedback.
I think the macros plugin is what you're looking for☺️