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.
I think they need to be escaped. I'd first try '{{ PAGE_ID}}'
to see if it works.
Yes, so do I, but I cannot find the way to escape as I have tried '
but didn’t work.
Does escaping like this work? \{{ PAGE_ID}}
. I think this is because Blot uses Mustache to render templates
Thanks! I’ve tried the pattern by using \
at the beginning but it didn’t work.
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 a year ago · Edit answer