渲染“”中的 Jekyll YAML 问题

Jekyll YAML issue in rendering ""

我正在写一些 Jekyll,这是我的 front-matter 标签:

---
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>
---

我想在标题周围加上引号,除了“”之外的摘录引述似乎根本没有在网站上呈现并且似乎会引发错误。我应该怎么做才能在 html 文件的 YAML 部分中表示引号? 我怎样才能在摘录中显示引语?

几件事:

  1. 您应该可以使用单引号 ' 或双引号 ",但不能使用弯引号 “”。如果您的字符串中没有逗号,那么没有引号也应该没问题。
  2. 如果您在 _config.yml 中定义并使用 excerpt_separator,系统会自动为您生成 post.excerptJekyll Docs - Posts
  3. 您无需将 HTML 传递给您的任何头版内容。您可以简单地使用 strip_htmlmarkdownify 过滤器调用它以去除 links/formatting 并将其包装在 <p> 标记中。 Jekyll Docs - Templates

{{ page.excerpt|strip_html|markdownify }}

编辑:我可能看错了,但是要在前面的这些位之一中加上引号,您可以使用反斜杠将其转义:

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