Any way to exclude files/directories from liquid processing?

I have some content in my markdown files that contains text resembling liquid syntax. This results in warnings at build time and text disappearing from the rendered documents.

At the moment I use the {% raw %}{% endraw %} syntax to stop this from happening but I’d rather not pollute my markdown with this ugliness.

Is there a way to make jekyll/liquid ignore liquid syntax in the entire markdown documents? Ideally I would like to have something like a .liquidignore file in the root of the project and be able to specify exclusions at a file/directory level there.

Sounds like v4.0 added a render_with_liquid frontmatter variable you can set (albeit on each file, I think):

---
render_with_liquid: false
---

(See “Jekyll processes all Liquid filters in code blocks” from here)

2 Likes

Brilliant, thanks! It would’ve been nicer to have a handful of entries in a config file somewhere than hundreds of frontmatter changes but it’s better than nothing.

1 Like

You can use front matter defaults in your config to assign variables to groups of files instead of adding directly to each.

3 Likes

Ah, that’s much better, thank you!

1 Like