Charlie Schliesser
Charlie Schliesser

Reputation: 8227

Can I have a Jekyll collection that uses a date in its filename?

I need to build a Jekyll collection – events – that has a title, a date, and a few other front matter variables:

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

My collection is configured as:

collections:
  events:
    output: true

I want these to exist in the _events folder like

- 2018-03-09-tournament.md

and to be output in _site like:

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

I've tried many combinations of things on the permalink attribute in _config.yml, but am unable to get my event to render if it includes a date in the filename.

Is this possible? What am I missing?

Upvotes: 0

Views: 268

Answers (1)

David Jacquel
David Jacquel

Reputation: 52809

You can configure permalink like this :

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

Upvotes: 1

Related Questions