Search code examples
yamljekyllgithub-pages

Jekyll treating YAML hyphens as dashes


Jekyll is not parsing a post correctly, and I can't find the error; the YAML front matter is the same as in our other posts. Here are the two differences:

(1) For some reason, Jekyll is rendering the three dashes at the bottom of the YAML front-matter as a single dash: category: German — Doch is a modal particle,. I have tried deleting these hyphens and retyping them, and that has not solved the problem.

(2) We are trying to create a new category with this post called "German." Jekyll has automatically created our categories from other posts, but in this instance, it is not creating the "German" category and is instead placing the post in a folder of its own.

When I open the page in the browser, I see this at the top:

layout: post author: WordBrewery title: “How to use the German doch” description: “How to use and understand the German modal particle doch.” image: hohenschwangau.jpg featured: true published: true category: German — Doch is a modal particle, a word used to indicate attitude, tone or the focus of a sentence.

Here is the YAML front-matter and first line of the post:

---
layout: post
author: WordBrewery
title: "How to use the German doch"
description: "How to use and understand the German modal particle doch."
image: hohenschwangau.jpg
featured: true
published: true
category: German
---
*Doch* is a [modal particle](https://en.m.wikipedia.org/wiki/German_modal_particle), a word used to indicate attitude, tone or the 

I would greatly appreciate any help.

Appearance of the unparsed post


Solution

  • (Moved from comments to answer)

    You need to make sure that the markdown file encoding is correct (utf8 no BOM). Jekyll has a problem with BOM in the front matter http://jekyllrb.com/docs/frontmatter/