Using Liquid Templating Filters in Jekyll
My current site uses Jekyll, as I’ve indicated before. Jekyll uses the Liquid template language which is common within Jekyll, Salesforce desk, Zendesk, and many other platforms. While Jekyll uses Liquid, it does not use the most current version and does not support all of the appropriate templating filters. Therefore, you should check out the Liquid section of the Jekyll site which can be found at jekyllrb.com/docs/liquid/.
An example of something that doesn’t work is this. Let’s assume I’m trying to replace the double-quotes in a title on the site. I typically would do something similar to this:
1
page.title | replace: "\"", ""
However, this doesn’t work. Rather, I needed to use the smartify
filter to convert the double quotes to smart quotes.
1
page.title | smartify
This now lets me use the title as a value of an HTML attribute such as when I need to use it with the aria-label
attribute.