Your sites Log in Sign up Menu

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.


3 months ago, 5 replies   posts   bug   Improve this question

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

Answered a year ago · Improve this answer

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

Answered a year ago · Improve this answer

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

Answered a year ago · Improve this answer

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

Answered a year ago · Improve this 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 3 months ago · Improve this answer