File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -44,3 +44,25 @@ options:
4444- Use ` --section ` to select a top-level key from the input data.
4545- Use ` -I ` to add directories to the template search path. This allows templates
4646 to include/import from those directories. Can be specified multiple times.
47+
48+ ## Template globals
49+
50+ ### ` environ(key) `
51+ Access environment variables:
52+ ``` jinja
53+ {{ environ("HOME") }}
54+ {{ environ("USER") }}
55+ ```
56+
57+ Returns ` None ` if the variable is not set. With ` --strict ` , raises an error
58+ for missing variables.
59+
60+ ### ` get_context() `
61+ Access the root data context. Useful for iterating over all input data:
62+ ``` jinja
63+ {{ get_context() | length }} entries
64+
65+ {% for key, value in get_context().items() %}
66+ {{ key }}: {{ value }}
67+ {% endfor %}
68+ ```
You can’t perform that action at this time.
0 commit comments