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
Can't include a file that has macro definitions in it #40
Comments
Not sure how you're trying to put to your macro definitions to get that error, but that error will remain in there even if you can import macro definitions from another file. It indicates that you're trying to define a macro somewhere not at the top-level of a template file, is that what you're doing? Macro imports are definitely on the list, just lower priority than escaping by default right now. |
Yeah I have a macros.html file with macros definitions in it and am including it in another template. Do you think there is a better way to fix that than changing how include currently works and parse the included file at the beginning and include its nodes in the current template nodes ? (parse it here and append nodes to the current nodes somehow) https://github.com/djc/askama/blob/master/askama_derive/src/generator.rs#L17 |
Jinja very clearly separates |
Thanks to @larros for fixing this! |
Hey,
It would be great to be able to have macros in a file and be able to include that file in another.
Currently it's hitting
panic!("no extends or macros allowed in content");
.The text was updated successfully, but these errors were encountered: