Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for TwigJS #7

Open
stevelacey opened this issue Jul 18, 2014 · 2 comments
Open

Add support for TwigJS #7

stevelacey opened this issue Jul 18, 2014 · 2 comments

Comments

@stevelacey
Copy link

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
Copy link
Author

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
Copy link
Owner

@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 😉. If your above example is what it takes, it shouldn't be difficult. Check out the mustachejs template tag for an example.

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

No branches or pull requests

2 participants