Add hook for setting global variables
This commit is contained in:
parent
d2777ba027
commit
9eb09cf695
3 changed files with 9 additions and 0 deletions
6
hooks/globals.py
Normal file
6
hooks/globals.py
Normal file
|
@ -0,0 +1,6 @@
|
|||
def on_env(env, config, files):
|
||||
env.globals["globals"] = {
|
||||
"foo": "bar"
|
||||
}
|
||||
|
||||
return env
|
|
@ -15,6 +15,7 @@ hooks:
|
|||
- hooks/page-render.py
|
||||
- hooks/static.py
|
||||
- hooks/redirects.py
|
||||
- hooks/globals.py
|
||||
|
||||
markdown_extensions:
|
||||
- attr_list
|
||||
|
|
|
@ -14,3 +14,5 @@ Children: {{ page|children }}
|
|||
Found page: {{ tag_1_page }}
|
||||
|
||||
Image resized: {{ "./assets/test.jpg"|resize_image(1500) }}
|
||||
|
||||
Globals: {{ globals.foo }}
|
||||
|
|
Loading…
Reference in a new issue