-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Raw Template Tag #37
Comments
This would be needed to use the official jQuery template plugin in Liquid templates: http://api.jquery.com/category/plugins/templates That plugin uses double curly braces for all its tags, except for the alias ${ output } which is a short version for:
Adding a “raw” tag may also solve the problem we currently have with Assistly. Assistly lets us use Liquid in replies to customers. That means that design supporters cannot share code snippets in a reply. Anything that uses double curly braces is 'parsed'. We have to create a gist every time we want to share a code snippet with our customers. We cannot use square brackets and ask them to make the substitution. Well, we can, but... that's so painful: “In the above code snippet you must change [[ to double { and ]] to double }.” |
Just to be clear, the only place you can place a jQuery template is inside a .liquid template, hence the road block. A jQuery template looks like this:
It's a script tag, so it cannot be placed in a .js file. As soon as you want to use logic in such template, you have to use the double curly braces notation: http://api.jquery.com/category/plugins/templates I was thinking about modifying the plugin itself but it's hosted on a CDN and it is updated and improved constantly. |
I'd love to see this feature. It would also help with mustache and other template languages beside jQuery.tmpl(). Because - according to "Liquid for Programmers" - Liquid parses all block tags, we'd have to patch liquid itself. A custom block tag itself can't help here. |
Wrote a proof of concept which i'm using for my jekyll generated site: https://gist.github.com/1020852 . Should be trivial to include it in other projects. |
Well, it seems like there is a little issue in this implementation: If you use {{ variable }} inside a html attribute it gets masked. For example:
becomes
I'll have a look into this during the next days. |
It would be great to see a template tag for handling raw code:
{% raw %}
{% this shouldnt get evaluated %}
{% endraw %}
The text was updated successfully, but these errors were encountered: