Skip to content
This repository has been archived by the owner on Mar 18, 2022. It is now read-only.

Working with html + swig? #79

Open
gonzalodiaz opened this issue Nov 11, 2014 · 1 comment
Open

Working with html + swig? #79

gonzalodiaz opened this issue Nov 11, 2014 · 1 comment

Comments

@gonzalodiaz
Copy link

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

@tsestrich
Copy link

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 %}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants