1
Fork 0

Render page content

This commit is contained in:
Jake Howard 2023-09-10 14:44:04 +01:00
parent 641a157a7b
commit b68cb5d337
Signed by: jake
GPG Key ID: 57AFB45680EDD477
3 changed files with 10 additions and 0 deletions

View File

@ -7,3 +7,5 @@ Before image
After image
![Image](https://theorangeone.net/images/ml7eDl0dfJcNa0gb78bceOAZA2Y=/1/width-1200/header.jpg)
{{ 1 + 2}}

7
hooks/page-render.py Normal file
View File

@ -0,0 +1,7 @@
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)

View File

@ -10,6 +10,7 @@ hooks:
- hooks/nav.py
- hooks/tags.py
- hooks/images.py
- hooks/page-render.py
markdown_extensions:
- attr_list