Log in Sign up

Ordering posts?

Is there a way to set the order of posts? Maybe be pre-fixing filenames or something like that?


5 months ago, 7 replies   developers   Edit question

My understanding is that your posts are going to be ordered by date of publication. But you can set that in the metadata by including (for example) "Date: December 1, 2021" in the header of your post.

In other words, by backdating it, you can set the order.

Or if you want to schedule more than one per day, you can use the hour:minute format for the date and simply advance the date by one minute.

So:

12/1/2021 01:01 12/1/2021 01:02

I could be wrong about this, so if I am, I am happy to be corrected.

Answered 3 years ago · Edit answer

You are correct that posts are ordered by date. I'm open to adding other methods of sorting posts but this is not yet implemented

Answered 3 years ago · Edit answer

It would be great if it could order by last updated date. Any plans for adding that feature? Or is there a workaround ?

Answered 9 months ago · Edit answer

I want to add support for ordering by path, updated date, publish date. I'm just unsure how to add this. Should it be a global setting on the dashboard? Should it be handled within the template source code? If so, what syntax for the template? Perhaps a new tag, e.g.

{{#posts-sorted-by-updated}}
...
{{/posts-sorted-by-updated}}

Or a new setting in package.json, e.g.

"sort": "updated"

My intuition is that this is best handled at the template-level, rather than a global setting. What are your thoughts?

Answered 9 months ago · Edit answer

could you make it possible to order by file name (e.g. 01_post.md, 02_post.md, etc.)? or did you mean it by "ordering by path"?

Answered 6 months ago · Edit answer

I like the template level for max flexibility...

Ray

Answered 5 months ago · Edit answer

(cant edit posts here anymore?)

Might be wise to offer both for newbies and experts...

Ray

Answered 5 months ago · Edit answer