I'm using nunjucks to render some variables:
<div class="zoomable zoomable-{{ slide.index }}"> << this works
{% if slide.temp is none %} << this doesn't
{% include "layouts/"+{{slide.layout}} %} << this doesn't
{% endif %}
</div>
When the JS calls nunjucks.render, I get the following error:
parseAggregate: expected colon after dict key
on the include
There are two issues with this:
temp
doesn't exist. slide
properties? Because slide.layout
is valid Am I doing something wrong?
我认为您只需要删除curly brackets
即
{% include "layouts/" + slide.layout %}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.