嗨,我昨天发了一篇题为“Oi”的帖子,现在我正试着用一个不同的标题写一篇新的帖子,但它试图搞乱旧的一个,我就是
获取此警告和错误消息:
WARNING: There are 2 variants of "oi" with lang en
WARNING: Development/web_projects/weeklyUpdate/content/2015_06_06_oi.md
WARNING: Development/web_projects/weeklyUpdate/content/2015_06_07_oi.md
CRITICAL: File Development/web_projects/weeklyUpdate/output/oi.html is to be overwritten
看起来,两篇文章都有相同的slug(post URL的本地部分)。可以通过“日期”字段或“标题”字段显式地生成。在你的例子中,两篇文章都有相同的URL“/oi.htmlpelican拒绝用第二篇文章的内容覆盖第一个生成的文件。在
假设你的内容目录中有两篇文章
标题相同但作者/内容不同。在
post1.md
^{pr2}$post2.md
因为鹈鹕用帖子标题“重击”这些帖子,它会导致名字冲突,你会看到。在
解决方案是向每个post添加
Slug: my-slug-line
元数据,以强制post呈现到my-slug-line.html
。在我们的例子中:post1.md
post2.md
这将把Jekyll博士的第一篇文章输出到
oi-dr-jekyll.html
,将海德先生的第二篇帖子输出到oi-mr-hyde.html
。在Slug:
元数据是可选的,因此除非遇到命名冲突,否则您不需要来执行此操作。但它有时会派上用场。在另请注意:
如果您想对非blog或“静态”页面执行相同的操作,比如用Markdown编写的“About Me”页面,那么可以使用
save_as: my_page.html
元数据强制将Markdown呈现为my_page.html
,不管页面标题是什么。在相关问题 更多 >
编程相关推荐