【发布时间】:2016-09-14 05:21:35
【问题描述】:
Jekyll 没有正确解析帖子,我找不到错误; YAML 前面的内容与我们其他帖子中的相同。以下是两个区别:
(1) 出于某种原因,Jekyll 将 YAML 前端内容底部的三个破折号渲染为一个破折号:category: German — Doch is a modal particle,。我已经尝试删除这些连字符并重新键入它们,但这并没有解决问题。
(2) 我们正在尝试使用此帖子创建一个名为“德语”的新类别。 Jekyll 自动从其他帖子创建了我们的类别,但在这种情况下,它并没有创建“德语”类别,而是将帖子放在自己的文件夹中。
当我在浏览器中打开页面时,我在顶部看到这个:
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.
这里是 YAML 的前端和帖子的第一行:
---
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
如果有任何帮助,我将不胜感激。
【问题讨论】:
-
文件的编码是否与正常工作的帖子不同?
-
确保使用 utf-8 编码保存文件,没有 BOM。
-
谢谢你们;我认为这可能是问题所在,并在 Emacs 中将编码重新保存为 utf-8(原件是在 Atom 的 Windows PC 上起草的),但显然这并没有删除 BOM(并且 BOM 在空白模式下不可见)。然后我切换到 Sublime Text 并尝试将其打开为 UTF-8 并将其保存为 UTF-8,这很有效。谢谢!
-
PS - 不幸的是,我的声誉为 1,似乎无法投票给您的 cmets。
标签: yaml jekyll github-pages