#Sort by date

3 messages · Page 1 of 1 (latest)

grim delta
#

I want to show the articles from my web in order depending on its publication date. I'm using Astro.glob. How can I sort them by its date??

molten cedarBOT
#

Hi @grim delta. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:

#

Astro's Astro.glob() function returns an array of objects, each representing a blog post. However, the extracts provided do not include information on how to sort these posts by their publication date using Astro.glob().

You might need to implement a sorting function in JavaScript to sort the array of posts returned by Astro.glob() based on the pubDate property of each post.

Please refer to the Astro documentation (https://docs.astro.build) for more detailed information or potential updates on this topic.

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: