Jekyll: escape HTML in titles

At times, you’ll have posts which don’t have pure text titles. Luckily, Jekyll supports a handy selection of custom filters along with all Liquid filters.

The strip_html filter is great for Jekyll layouts:

{{ page.title | strip_html }}

As an additional note, if you need to escape Jekyll snippets in code blocks as above, you can use {% raw %}{% endraw %} to embed your content.