Log in Sign up

Escaping template variables in posts?

I am writing a post to share some setting, seems the variables will be disappeared if there is a conflict of template. Here's what I have on iA Writer and this is what it looks like after rendering by Blot.


10 months ago, 5 replies   posts   bug   Edit question

I think they need to be escaped. I'd first try '{{ PAGE_ID}}' to see if it works.

Answered 2 years ago · Edit answer

Yes, so do I, but I cannot find the way to escape as I have tried ' but didn’t work.

Answered 2 years ago · Edit answer

Does escaping like this work? \{{ PAGE_ID}}. I think this is because Blot uses Mustache to render templates

Answered 2 years ago · Edit answer

Thanks! I’ve tried the pattern by using \ at the beginning but it didn’t work.

Answered 2 years ago · Edit answer

Not sure whether this is still important to someone, but you can work around this problem by temporarily changing around the Moustache delimiter:

{{=<% %>=}}{{{avatar_url}}}<%={{ }}=%>

This will render as:

{{{avatar_url}}}

Other than that, there seems to be no possiblity to escape Moustach code.

Answered 10 months ago · Edit answer