Comments (5)
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:
{{= output }}
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 }.β
from liquid.
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:
<script id="my-template" type="text/x-jquery-tmpl">
<li>
<a href="${url}">
<span class="title">${title}</span>
</a>
</li>
</script>
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.
from liquid.
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.
from liquid.
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.
from liquid.
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:
<a href="#{{id}}">{{name}}</a>
becomes
<a href="#%7B%7Bid%7D%7D">Test</a>
I'll have a look into this during the next days.
from liquid.
Related Issues (20)
- Can not use where filter on images
- Missing 4.0.4 release in changelog
- Feature request: add where_exp from Jekyll or something similar
- Test fails with Fedora glibc -2.38.9000-20.fc40 and onwards, perhaps due to qsort behavior change HOT 2
- https://salla.sa/bero-2030.com
- loop through list.metaobject_reference metafield's not working HOT 1
- Cropped images in srcset using image_tag HOT 2
- weight_with_unit Filter Rounding is not Accurate
- img_tag widths are not working correctly HOT 1
- font_url displays error with preload_tag due to whitelist HOT 3
- How to remove Tab space with strip or strip_newlines? HOT 3
- Ruby 3.3 deprecation warnings: base64, bigdecimal will no longer be part of the default gems HOT 1
- Why doesn't parse_json take effect? HOT 1
- Fix Wiki reference
- Custom Liquid::Drop that is called for every missing variable HOT 1
- Possible to get full object & variable name with `strict_variables: true`?
- video_tag fully disable poster HOT 2
- Expose Liquid::Condition in public API
- alt attribute not set for media.preview_image with image_tag filter HOT 1
- Running rake example throws error
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from liquid.