-
-
Notifications
You must be signed in to change notification settings - Fork 280
Open
Description
Version: github.com/flosch/pongo2/v6 v6.0.0
Background
I have a macro main which i want to use in my templates. To implement this macro, i rely on child macros -child.
{% macro child() %}Child{% endmacro %}
{% macro main() export %}Main calls {{ child() }}{% endmacro %}What is the issue
main does not work correctly when imported.
How to reproduce ?
-
Create
macros.j2with the contents above. -
Create
test1.j2with the following contents:
{# filename: test1.j2 #}
{% import "macros.j2" main %}
{{ main() }}- Render
test1.j2using the default options. We get the following output:
Main calls
Expected output:
Main calls Child
Other details (may be useful)
When the macro is called from the same file such as below, we get the expected output:
{# filename: test2.j2 #}
{# macro definition above is pasted here #}
{{ main() }}Metadata
Metadata
Assignees
Labels
No labels