Hexo: Anyway to disable curly braces interpolation in markdown?

Created on 3 Mar 2015  路  4Comments  路  Source: hexojs/hexo

Markdown source files that contain curly braces, e.g. {{title}}, are considered template interpolations against the YAML front-matter of that post. I have to escape the braces like {{title}} in order to output them without causing a hexo error.

In hexo 2.x this behavior also affects code inside markdown code blocks, which makes writing code samples for curly brace templates very annoying. Now in 3.0 this has been fixed, which is great.

However I would still like to have a config option that allows me to completely disable this feature. I don't really need interpolation in my markdown; I just want to use curly braces as I would in normal HTML.

feature-request

Most helpful comment

All 4 comments

+1

+1 for using {% raw %} and {% endraw %}

Btw, how to display {% raw %} and {% endraw %} in a post?

Was this page helpful?
0 / 5 - 0 ratings