tera
tera copied to clipboard
error while importing
there is no much documentation about imports nor tests in the source code i tried making simple two files
<!-- index.html -->
<html>
{% import "header.html" as header %}
{{ header::head() }}
<body>
hello world
</body>
</html>
<!-- header.html -->
{% macro head() %}
<head>
<title> title </title>
</head>
{% endmacro head %}
and I got this error
okay i fixed it. looks like the {% import %} statmetns needs to be at top level of the tml like
{% import "header.html" as header %}
<html>
{{ header::head() }}
<body>
hello world
</body>
</html>
but there is nothing that says that at the documentation. there is literally only 2 lines about import and they don't talk about this!