express-cdn
express-cdn copied to clipboard
Working with html + swig?
Is this library able to work with html + swig instead of jade or ejs?
I had this code:
{% for cssFile in cssFiles %}<link rel="stylesheet" href="{{cssFile}}">
{% endfor %}
where cssFiles it is the list of Css Files stored as String in a config file.
I've change it to this:
{% for cssFile in cssFiles %}
<script type="text/javascript">
var cssFileVal = "{{cssFile}}";
{{ CDN(cssFileVal) }}
</script>
{% endfor %}
But the code in {{}} is not pre processed, so I end having this:
{ "assets": cssFileVal }
^
SyntaxError: Unexpected token c
I will really appreciate some help to make this work. Thanks
This was a long time ago, but I wanted to comment that I do use SWIG with this just fine. Without running the code above, it looks like its a mistake in the code itself. It should be something like:
{% for cssFile in cssFiles %}
{{ CDN(cssFileVal) }}
{% endfor %}