In the front matter of your Jekyll posts, you might want to include a colon. However, if you don't escape it, you will get an "Error: YAML Exception reading …" error.
There are 3 ways to escape the colon in the Front matter of your posts.
-
Put the text around quotes.
Wrong
title: How to escape colon: in Front matter YAML
Correct
title: "How to escape colon: in Front matter YAML"
-
Replace the colon with
:
title: "How to escape colon: in Front matter YAML"
The Jekyll YAML parser will replace it will the :
-
Use a greater than sign (>) and put the text indented and in a new line.
title: > How to escape: colon in Front matter YAML?
Personally, whenever I need to escape the colon (:), I just put the value around quotes.