From c01083ef9e8d2e30eac2e44855d5e08b8e775eab Mon Sep 17 00:00:00 2001 From: nsfisis Date: Wed, 29 Mar 2023 01:22:53 +0900 Subject: feat(nuldoc): sort slides in about page --- nuldoc-src/pages/about.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'nuldoc-src') diff --git a/nuldoc-src/pages/about.ts b/nuldoc-src/pages/about.ts index 459b88c..3306006 100644 --- a/nuldoc-src/pages/about.ts +++ b/nuldoc-src/pages/about.ts @@ -117,7 +117,13 @@ export async function generateAboutPage( el( "ul", [], - ...slides.map((slide) => + ...Array.from(slides).sort((a, b) => { + const ta = dateToString(getPostCreatedDate(a)); + const tb = dateToString(getPostCreatedDate(b)); + if (ta > tb) return -1; + if (ta < tb) return 1; + return 0; + }).map((slide) => el( "li", [], -- cgit v1.2.3-70-g09d2