1
Fork 0
mkdocs-site/hooks/page-render.py
Jake Howard 0305754b83
Render pages with config
Mostly useful if template tags want to use it
2023-09-17 17:15:28 +01:00

10 lines
418 B
Python

from mkdocs.plugins import event_priority
@event_priority(100)
def on_page_markdown(markdown, page, config, files):
# HACK: Calculate what the `env` should probably look like. By default, `on_env` is called after `on_page_markdown`.
env = config.plugins.on_env(config.theme.get_env(), config=config, files=files)
template = env.from_string(markdown)
return template.render(page=page, config=config)