Fix updated logic for all posts page
This commit is contained in:
@@ -10,8 +10,8 @@ import { SITE_TITLE, SITE_DESCRIPTION } from "../config";
|
|||||||
// Use Astro.glob() to fetch all posts, and then sort them by date.
|
// Use Astro.glob() to fetch all posts, and then sort them by date.
|
||||||
const posts = (await Astro.glob("../posts/*.md")).sort(
|
const posts = (await Astro.glob("../posts/*.md")).sort(
|
||||||
(a, b) =>
|
(a, b) =>
|
||||||
new Date(b.frontmatter.added).valueOf() -
|
new Date(b.frontmatter.updated || b.frontmatter.added).valueOf() -
|
||||||
new Date(a.frontmatter.added).valueOf()
|
new Date(a.frontmatter.updated || a.frontmatter.added).valueOf()
|
||||||
);
|
);
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user