Giter VIP home page Giter VIP logo

Comments (10)

subosito avatar subosito commented on July 20, 2024

Hi benubois, just found simple solution, not clean but works ;)
You can use format below (example):

{{ "{{ site.title " }}}}

and

{{ "{% include partial.html " }}%}

from liquid.

rossmeissl avatar rossmeissl commented on July 20, 2024

As you say, not clean . . . would love to see some first-class escaping in Liquid so that I can talk about Liquid on my Jekyll-powered blog.

from liquid.

DBA avatar DBA commented on July 20, 2024

What syntax would you guys recommend?

from liquid.

DBA avatar DBA commented on July 20, 2024

I think I'm almost done implementing this but my regexp newbness is taking its best.

If you're a regexp guru ready to save my day: http://stackoverflow.com/questions/3551737/problem-with-regexp-trailing-space

Cheers,
DBA

from liquid.

DBA avatar DBA commented on July 20, 2024

Implemented at: http://github.com/GnomesLab/liquid/tree/v2.2.1

Examples:

{% literal %}{% if '1' == '1' %}yes{% endif %}{% endliteral %}

Or the shorthand version (3 curly bracers)

{{{{% if '1' == '1' %}yes{% endif %}}}}

from liquid.

subosito avatar subosito commented on July 20, 2024

Hi DBA, both version is amazing. I think that's clean enough.
Best,

from liquid.

DBA avatar DBA commented on July 20, 2024

Was actually considering something even shorter like

{* my literal *}

This would be more inline with the upcoming {# comment #} syntax. However I'm afraid some people confuse both and start having literals when they wanted a comment.

If tobi wishes it could change in liquid 3 or something. For now, a more cryptic 3 curly bracers syntax is harder to do by mistake.

from liquid.

NathanHazout avatar NathanHazout commented on July 20, 2024

Is this documented anywhere?

from liquid.

NathanHazout avatar NathanHazout commented on July 20, 2024

I have a Jekyll 3 site, and I want to use jsrender as well.

I want to print:

<script id="myTemplate" type="text/x-jsrender">
Name: {{:name}}
</script>

What's the correct way?
I tried {{{{:name}}}}, {{ "{{:name}}" }}, nothing works...

from liquid.

NathanHazout avatar NathanHazout commented on July 20, 2024

I found the doc: https://github.com/Shopify/liquid/wiki/Liquid-for-Designers#raw

from liquid.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.