-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to call macro when included instead of imported: Closure call with mismatched arguments #31
Comments
Can you provide an example with blocks? Use import. |
|
Macro imports in general seem very flaky or not as robust as the examples in the Jinja documentation may lead to believe. For example, importing 2 files under {% import "components/a.jinja" as components %}
{% import "components/b.jinja" as components %}
{{ components.a() }}
{{ components.b() }} and {% from "components/a.jinja" import components as a %}
{% from "components/b.jinja" import components as b %}
{{ a() }}
{{ b() }}
|
The {% extends "base.jinja" %}
{% import 'component.jinja' as components %}
{% block content %}
{{ components.component("hey") }}
{% endblock %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I don't know if this is a supported way of using macros, but I thought I should report it here. As a side note: In templates where blocks are used,
import
statements don't work when not put insideblock
statements (if the template extends another), leading to me trying this cursed method.Package version: 0.6.1-dev.5
Error
component.jinja
page.jinja
The text was updated successfully, but these errors were encountered: