When I first started this blog, I noticed that my quotes (single and double) were "smart quotes" or as I like to refer to them "fancy quotations".
Since my blog has a lot of programming articles, I didn't want to have smart quotes as it messes up people's ability to copy and paste code from my site.
How to turn off smart quotes in Jekyll?
Since Kramdown is the default Markdown renderer for Jekyll, it is what I am using and what you are likely using too.
Kramdown by default uses smart quotes (check out the Kramdown documentation here).
To turn off fancy quotes in Jekyll do the following:
Open your _config.yml file
You should have a kramdown option that looks like this:
kramdown: input: GFM auto_ids: true hard_wrap: false syntax_highlighter: rouge
The important thing to notice is it likely doesn't have the smart_quotes option defined - meaning it is using the default one. So in the next step, we will add the option to disable the smart quotes in Jekyll.
Add this option so that kramdown knows not to use smart quotes or single quotes:
smart_quotes: ["apos", "apos", "quot", "quot"]
So in the end it should look something like so:
kramdown: input: GFM auto_ids: true hard_wrap: false syntax_highlighter: rouge smart_quotes: ["apos", "apos", "quot", "quot"]
That's it, smart quotes should now be turned off in Jekyll.
This works because the first two "apos" replaces the smart single quote with a regular single quote apostrophe and the last two "quot" replaces the smart double quotes with regular quotes.
I hope you now know how to remove smart quotes in Jekyll.