mjumbewu / django-jstemplate

Embed Javascript templates (mustache.js and more) into Django templates with minimal fuss.
Other
41 stars 16 forks source link

Add support for TwigJS #7

Open stevelacey opened 10 years ago

stevelacey commented 10 years ago

I am just using doing this for now and parsing the template manually:

<script type="text/x-twig-template" id="example-template">
    {% rawjstemplate 'example-template' %}
</script>

But, formal support for Twig.js would be cool.

stevelacey commented 10 years ago

As an added bonus, being able to name the file example-template.html.twig would be more self-descriptive and consistent with other implementations.

mjumbewu commented 10 years ago

@stevelacey you can control the extension that django-jstemplate looks for with the JSTEMPLATE_EXTS setting variable (e.g., JSTEMPLATE_EXTS = ['html.twig']).

For the formal support, I would gladly accept a pull request :wink:. If your above example is what it takes, it shouldn't be difficult. Check out the mustachejs template tag for an example.