我可以拥有一个在文件名中使用日期的 Jekyll collection 吗?
Can I have a Jekyll collection that uses a date in its filename?
我需要构建一个 Jekyll collection – events
– 它有一个标题、一个日期和一些其他的前端变量:
---
title: Tournament
date: 2018-03-09 00:00:00
date_end: 2018-03-01 20:00:00
description: A big tournament is coming.
---
我的collection配置为:
collections:
events:
output: true
我希望它们像
一样存在于_events
文件夹中
- 2018-03-09-tournament.md
并在 _site
中输出,例如:
- /event/2018-03-09-tournament/index.html
我在 _config.yml
的 permalink
属性上尝试了很多组合,但如果我的事件在文件名中包含日期,我将无法呈现它。
这可能吗?我错过了什么?
您可以这样配置 permalink :
collections:
events:
output: true
future: true
permalink: "/event/:year-:month-:day-:name/index:output_ext"
我需要构建一个 Jekyll collection – events
– 它有一个标题、一个日期和一些其他的前端变量:
---
title: Tournament
date: 2018-03-09 00:00:00
date_end: 2018-03-01 20:00:00
description: A big tournament is coming.
---
我的collection配置为:
collections:
events:
output: true
我希望它们像
一样存在于_events
文件夹中
- 2018-03-09-tournament.md
并在 _site
中输出,例如:
- /event/2018-03-09-tournament/index.html
我在 _config.yml
的 permalink
属性上尝试了很多组合,但如果我的事件在文件名中包含日期,我将无法呈现它。
这可能吗?我错过了什么?
您可以这样配置 permalink :
collections:
events:
output: true
future: true
permalink: "/event/:year-:month-:day-:name/index:output_ext"