Collection items with future date are published


#1

I’ve created a collection, we’ll call it “mycoll.” I’ve added three items on different dates, one in the future. In each item, I use the following front matter:

date: 2017-03-14 00:00:00-04
link: https://www.example.com/nowhere
preview: preview-image.png

The collection is configured with output: false in _config.yml, and I do not have future: true set anywhere, nor do I build with the --future flag. I access the collection in the following way:

{% assign item = site.mycoll.last %}

For whatever reason, the result I get is the item with the date in the future. According to the documentation, this shouldn’t be possible. What am I missing?

I’m using Jekyll 3.4.2.


#2

From what I have experienced (no experience using dates in collections though), the collection data is always available - output means jekyll will copy/render the files from the collection folder into the site folder. So with output false, you can still access the collection data in liquid.

I think you have found a gray area, where the collection data is available but since you have a future date it maybe should not be. The docs maybe assuming that you have output set to true, and then maybe the future date would mean it does not get output?


#3

I’ve confirmed that changing output to true makes it consider the date properly. That will work as a workaround for now, and I’ll just make the web server return a 404 for the output directory.

I’ll file a bug and we’ll see what happens. Thanks!