eudicots / Cactus

Static site generator for designers. Uses Python and Django templates.
BSD 3-Clause "New" or "Revised" License
3.47k stars 313 forks source link

Markdown filter not working with handlebar syntax in <code> element #151

Closed JamieBradders closed 9 years ago

JamieBradders commented 9 years ago

Hi there, I'm using the latest version of cactus for mac and I'm experiencing some issues with the markdown plugin. In my article I am trying to demonstrate an example of the templating language used in Cactus, of course this uses curly braces.

If I was to tab twice to enable code in markdown and then type

{{ hello }}

I would expect the following to be rendered in the front end:

<p>{{ hello }}</p>

Unfortunately, I get the following: <p> </p>

Can anybody please point out where I'm going wrong? I know that this can be done because it's used on the Cactus documentation - http://cactusformac.com/docs/extras.html#variables

krallin commented 9 years ago

{{ hello }} will cause the template engine (Django) to attempt to output the contents of the hello variable, regardless of indentation or anything.

You should be able to disable the template engine for this part of your template with:

{% verbatim %}
    {{ hello }}
{% endverbatim %}

Cheers,

JamieBradders commented 9 years ago

Hey, thanks very much. I'll be sure to consult the django docs first in future.

Jamie

krallin commented 9 years ago

As you do that; note that Cactus currently uses Django 1.5; which is a bit old. This might change in the future (but not just yet).

Cheers;