0

我正在尝试使用 Pelican 静态站点生成器来创建一个不是博客的静态站点。

文件夹内的每个 markdown 文件都content/posts包含以下数据。

---
name: Product Name here
price: Product Price goes here
image: Product Image goes here 
---

The description content in Markdown goes here

但是当我预览该站点时,我收到此错误消息:Skipping filename.md: could not find information about 'title'。如果我将所有降价文件移动到content/pages文件夹中,我会收到相同的错误消息。

我想在主页(index.html)上显示产品信息(如上图存储在markdown文件中)

如何使帖子文件夹中的内容不被视为文章,或者换句话说,使标题和日期元数据对于文章是可选的?

4

1 回答 1

1

将您的name字段重命名为title

---
title: Product Name here
price: Product Price goes here
image: Product Image goes here 
---

The description content in Markdown goes here

两者之间几乎没有语义差异,但 Pelican 需要title提要。或者,只需将其设置为未使用的值:

---
title: none
name: Product Name here
price: Product Price goes here
image: Product Image goes here 
---

The description content in Markdown goes here
于 2016-11-12T23:55:46.400 回答