我可以有一个在其文件名中使用日期的 Jekyll 集合吗?



我需要构建一个 Jekyll 集合 – events – 它有一个标题、一个日期和其他一些前言变量:

---
title: Tournament
date: 2018-03-09 00:00:00
date_end: 2018-03-01 20:00:00
description: A big tournament is coming.
---

我的集合配置为:

collections:
  events:
    output: true

我希望这些存在于_events文件夹中,例如

- 2018-03-09-tournament.md

并以_site输出,如下所示:

- /event/2018-03-09-tournament/index.html

我已经尝试了 _config.ymlpermalink 属性的许多组合,但如果文件名中包含日期,则无法呈现我的事件。

这可能吗?我错过了什么?

您可以像这样配置永久链接:

collections:
  events:
    output: true
    future: true
    permalink: "/event/:year-:month-:day-:name/index:output_ext"

最新更新