Slow Learner's Quest

← Back to TIL 05 May 2025

Sorting an Astro Glob

const posts = await Astro.glob('../content/blog/**/*.md');
posts.sort((a, b) => Date.parse(b.frontmatter.date) - Date.parse(a.frontmatter.date));