From 16182acfcc1fad2885b9c1a96fe74d8ce56a50e0 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sun, 12 Jan 2025 21:59:55 +0900 Subject: refactor(blog/nuldoc): separate pages/* to pages/* and generators/* --- vhosts/blog/nuldoc-src/pages/PostListPage.tsx | 41 +++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 vhosts/blog/nuldoc-src/pages/PostListPage.tsx (limited to 'vhosts/blog/nuldoc-src/pages/PostListPage.tsx') diff --git a/vhosts/blog/nuldoc-src/pages/PostListPage.tsx b/vhosts/blog/nuldoc-src/pages/PostListPage.tsx new file mode 100644 index 00000000..3fcfbf1f --- /dev/null +++ b/vhosts/blog/nuldoc-src/pages/PostListPage.tsx @@ -0,0 +1,41 @@ +import GlobalFooter from "../components/GlobalFooter.tsx"; +import GlobalHeader from "../components/GlobalHeader.tsx"; +import PageLayout from "../components/PageLayout.tsx"; +import PostPageEntry from "../components/PostPageEntry.tsx"; +import { Config } from "../config.ts"; +import { dateToString } from "../revision.ts"; +import { getPostPublishedDate, PostPage } from "../generators/post.ts"; + +export default function PostListPage( + posts: PostPage[], + config: Config, +) { + const pageTitle = "投稿一覧"; + + return ( + + + +
+
+

{pageTitle}

+
+ {Array.from(posts).sort((a, b) => { + const ta = dateToString(getPostPublishedDate(a)); + const tb = dateToString(getPostPublishedDate(b)); + if (ta > tb) return -1; + if (ta < tb) return 1; + return 0; + }).map((post) => )} +
+ + +
+ ); +} -- cgit v1.2.3-70-g09d2