Kirby overwrites dates in blog article titles for chronological ordering

Hi there,

I’m currently evaluating Kirby as a replacement for my Jekyll installation and most things look pretty great so far. :+1: The first question that I wasn’t able to find an answer for is the following:

When I create blog posts/articles with date strings in the folder’s name (as described here), Kirby somehow just overwrites them with the ordinary numbering (1, 2, 3, …). I’m not yet sure when or why exactly this happens, but it looks like it does this once I change one of the posts and save it.

Any ideas how to fix this?

I’m using Kirby/Panel/Toolkit version 2.2.2 inside MAMP with Markdown configured as the default file type for all my contents.

Thank you!

– Flo

Kirby doesn’t allow numbers in folder names other than for sorting or flagging them as visible. Having said that, there is an option to sort folders by date. In that case, the Kirby takes the date from the date field (or another field which is specified as date field) and prepends the date once the post is made visible.

If you manually add a date in your folder name and do not specify date based sorting in the corresponding blueprint file, the panel will fall back to numbered sorting and thus overwrite your date based sorting.

If you create a new post via the panel, do not add the date to the folder name, as this is done automatically.

Thanks for the fast reply! So, this means the information from the docs I linked to is not correct anymore?

Is there anything else I have to configure to make it work as you described?

In that case, the Kirby takes the date from the date field (or another field which is specified as date field) and prepends the date once the post is made visible.

I just tried it (I still had a few blog posts with the date prefix in my blog directory) and created a new blog article. In this article, the date got pre-filled with today’s date. I saved the article, made it visible (selecting the dash from the list) and Kirby just gave it a number (6, in this particular case), not a date. So I guess I’m doing something wrong here, huh?

The docs are correct. In the blueprint for the parent page of your posts (blog?), you need to specify the type of sorting you want for your articles, e.g.

#blog.php

…
pages:
  num: date
…
1 Like

Ah, that was the missing piece. This worked. Thanks a lot! :grinning: