mirror of
				https://github.com/valentineus/popov.link.git
				synced 2025-11-04 06:49:45 +03:00 
			
		
		
		
	Sort blog posts by publication date
This commit is contained in:
		@@ -4,6 +4,7 @@ import Element from "../components/PostElement.astro";
 | 
			
		||||
import Layout from "../layouts/BaseLayout.astro";
 | 
			
		||||
 | 
			
		||||
const posts = await getCollection("blog");
 | 
			
		||||
posts.sort((a, b) => b.data.pubDate.getTime() - a.data.pubDate.getTime());
 | 
			
		||||
---
 | 
			
		||||
 | 
			
		||||
<Layout>
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user