retypeapp / retype

Retype is an ✨ ultra-high-performance✨ static site generator that builds a website based on simple text files.
https://retype.com
Other
1.08k stars 204 forks source link

Mustaches disappear from code blocks and inline code #426

Closed joonaspaakko closed 2 years ago

joonaspaakko commented 2 years ago

Retype version: 2.4.0. I thought this wasn't always the case, but I tried to downgrade and it didn't seem to have any effect...


This:

{{ example }}

  {{ example }}

Becomes:


This:

{{ example }.}

  {{ example }.}

Becomes:

geoffreymcgill commented 2 years ago

The {{ example }} is getting caught be the templating engine. There are four options:

1. Disable Templating project wide

Add the following config to your retype.yml file:

templating:
  enabled: false

2. Disable Templating on the Page

Add the following config to your .md page metadata section:

---
templating: false
---
# My sample page

3. Escape that specific snippet

Wrap the snippet with templating {%{ and }%} escape tags.

```
{%{{{ example }}}%}
```

4. Escape the entire code block

Wrap the templating escape tags around the entire code block.

{%{
```
{{ example }}
```
}%}

Any one of the above options should solve the issue.

Hope this helps.

joonaspaakko commented 2 years ago

Ah right. It didn't occur to me that it might be a thing... I'm not using it so I disabled it.

Kreyu commented 1 year ago

For future reference: if your project is using liquid templating:

templating:
  liquid: true

wrap the codeblock in the {% raw %} tag:

{% raw %}

{{ example }}

{% endraw %}