Jwan622
Jwan622

Reputation: 11639

Jekyll YAML issue in rendering ""

I am writing some Jekyll and this is my front-matter tag:

---
layout: post
title: Running off the path into programming ... a gag-inducing excerpt from one of my B-school essays.
date: '2015-01-10T13:41:00+01:00'
tags:
- random
tumblr_url: http://www.iamthemangosteen.com/post/107708808069/running-off-the-path-into-programmingan-excerpt
excerpt: <p> ...But I was tired that day. I was tired of losing, tired of following my captain's juvenile policy of punishment runs, and tired of myself for lacking the curiosity to explore my beautiful campus and the surrounding forests. And so I ran off the path and after several miles of Berkshire forest, I entered the clearing of my college’s best kept secret our very own wildlife and bird sanctuary. I spent the rest of my afternoon discovering...</p>
---

I would like to put quotes around the title and the excerpt quote except "" doesn't seem to render at all in the site and seems to throw errors. What am I supposed to do to represent quotes in a YAML section of the html file? How can I get quotes to show up in the excerpt?

Upvotes: 0

Views: 510

Answers (1)

omgmog
omgmog

Reputation: 616

A couple of things:

  1. You should be able to use either single ' or double quotes ", but not curly quotes “”. Providing you have no comma's in your string, you should also be fine without quotes.
  2. If you define and use an excerpt_separator in your _config.yml, the post.excerpt will be automatically generated for you. Jekyll Docs - Posts
  3. You don't need to pass HTML in to any of your front-matter. You can simply call it with the strip_html and markdownify filters to strip links/formatting and wrap it in a <p> tag. Jekyll Docs - Templates

{{ page.excerpt|strip_html|markdownify }}

edit: I may have misread, but to put quote marks inside one of these bits of front-matter, you can use a backslash to escape it:

---
title: "This is a quote \" it is rendered."
---

Upvotes: 2

Related Questions