0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2025-03-10 23:01:26 -05:00

sort newest to oldest (#11587)

* sort newest to oldest

* Update pubDate to preserve a meaningful order in the examples/blog folder
This commit is contained in:
Jeff R 2024-08-05 06:30:06 -05:00 committed by GitHub
parent 196092ae69
commit 6e5676862b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 7 additions and 7 deletions

View file

@ -1,7 +1,7 @@
---
title: 'Markdown Style Guide'
description: 'Here is a sample of some basic Markdown syntax that can be used when writing Markdown content in Astro.'
pubDate: 'Jul 01 2022'
pubDate: 'Jun 19 2024'
heroImage: '/blog-placeholder-1.jpg'
---

View file

@ -1,7 +1,7 @@
---
title: 'Using MDX'
description: 'Lorem ipsum dolor sit amet'
pubDate: 'Jul 02 2022'
pubDate: 'Jun 01 2024'
heroImage: '/blog-placeholder-5.jpg'
---

View file

@ -7,7 +7,7 @@ import { getCollection } from 'astro:content';
import FormattedDate from '../../components/FormattedDate.astro';
const posts = (await getCollection('blog')).sort(
(a, b) => a.data.pubDate.valueOf() - b.data.pubDate.valueOf()
(a, b) => b.data.pubDate.valueOf() - a.data.pubDate.valueOf()
);
---

View file

@ -7,7 +7,7 @@ import { getCollection } from 'astro:content';
import FormattedDate from '../../components/FormattedDate.astro';
const posts = (await getCollection('blog')).sort(
(a, b) => a.data.pubDate.valueOf() - b.data.pubDate.valueOf()
(a, b) => b.data.pubDate.valueOf() - a.data.pubDate.valueOf()
);
---

View file

@ -7,7 +7,7 @@ import { getCollection } from 'astro:content';
import FormattedDate from '../../components/FormattedDate.astro';
const posts = (await getCollection('blog')).sort(
(a, b) => a.data.pubDate.valueOf() - b.data.pubDate.valueOf()
(a, b) => b.data.pubDate.valueOf() - a.data.pubDate.valueOf()
);
---

View file

@ -1,7 +1,7 @@
---
title: 'Using MDX'
description: 'Lorem ipsum dolor sit amet'
pubDate: 'Jul 02 2022'
pubDate: 'Jun 01 2024'
heroImage: '/placeholder-hero.jpg'
---

View file

@ -1,7 +1,7 @@
---
title: 'Using MDX'
description: 'Lorem ipsum dolor sit amet'
pubDate: 'Jul 02 2022'
pubDate: 'Jun 01 2024'
heroImage: '/placeholder-hero.jpg'
---