简体   繁体   中英

Is it possible to create a nunjuck template literal inside another nunjuck template literal in A-Frame?

I want to have a 'glass' template literal inside my 'building' template literal.

<script id="building" type="text/x-nunjucks-template">
  {% for x in range(0, 5) %}
  <a-entity template="src: building.template; type:         handlebars" position="{{ x * 5 }} 0 0">
  </a-entity>
  {% endfor %}
</script>

<script id="glass" type="text/x-nunjucks-template">
  {% for x in range(0, 5) %}
  <a-entity template="src: glass.template; type: handlebars" position="{{ x }} 2 2">
  </a-entity>
  {% endfor %}
</script>

I understand that they need to be run inside .HTML files - I just wondered if there was a work around so I could have the following:

index.html --> building.template --> glass.template

Thank you

Use {% raw %} .

{% raw %}
  some nunjucks templating
{% endraw %}

And it won't be rendered on the outer template.

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM