使用鹈鹕静态网站生成器进行博客以外的其他事情

2024-06-07 22:53:04 发布

您现在位置:Python中文网/ 问答频道 /正文

我尝试使用鹈鹕静态站点生成器来创建一个静态站点,而不是博客。在

content/posts文件夹中的每个降价文件都包含以下数据。在

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

The description content in Markdown goes here

但是当我预览站点时,我得到了一个错误消息:正在跳过文件名.md:找不到有关“title”的信息。。如果我将所有的降价文件移到content/pages文件夹中,则会收到相同的错误消息。在

我想在主页上显示产品信息(存储在上面所示的降价文件中)(索引.html)在

如何使posts文件夹中的内容不被视为文章,或者换句话说,使title&date元数据成为文章的可选内容?在


Tags: 文件数据文件夹信息消息here站点title
1条回答
网友
1楼 · 发布于 2024-06-07 22:53:04

name字段重命名为title

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

The description content in Markdown goes here

两者之间的语义差别不大,但鹈鹕需要title提要。或者,只需将其设置为未使用的值:

^{pr2}$

相关问题 更多 >

    热门问题