diff options
Diffstat (limited to 'vhosts/blog/nuldoc-src/pages/post_list.ts')
| -rw-r--r-- | vhosts/blog/nuldoc-src/pages/post_list.ts | 61 |
1 files changed, 0 insertions, 61 deletions
diff --git a/vhosts/blog/nuldoc-src/pages/post_list.ts b/vhosts/blog/nuldoc-src/pages/post_list.ts deleted file mode 100644 index 40df8ed9..00000000 --- a/vhosts/blog/nuldoc-src/pages/post_list.ts +++ /dev/null @@ -1,61 +0,0 @@ -import { globalFooter } from "../components/global_footer.ts"; -import { globalHeader } from "../components/global_header.ts"; -import { pageLayout } from "../components/page_layout.ts"; -import { postPageEntry } from "../components/post_page_entry.ts"; -import { Config } from "../config.ts"; -import { el } from "../dom.ts"; -import { Page } from "../page.ts"; -import { dateToString } from "../revision.ts"; -import { getPostPublishedDate, PostPage } from "./post.ts"; - -export type PostListPage = Page; - -export async function generatePostListPage( - posts: PostPage[], - config: Config, -): Promise<PostListPage> { - const pageTitle = "投稿一覧"; - - const body = el( - "body", - { className: "list" }, - globalHeader(config), - el( - "main", - { className: "main" }, - el( - "header", - { className: "page-header" }, - el("h1", {}, 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) => postPageEntry(post)), - ), - globalFooter(config), - ); - - const html = await pageLayout( - { - metaCopyrightYear: config.blog.siteCopyrightYear, - metaDescription: "投稿した記事の一覧", - metaKeywords: [], - metaTitle: `${pageTitle}|${config.blog.siteName}`, - metaAtomFeedHref: `https://${config.blog.fqdn}/posts/atom.xml`, - requiresSyntaxHighlight: false, - }, - body, - config, - ); - - return { - root: el("__root__", {}, html), - renderer: "html", - destFilePath: "/posts/index.html", - href: "/posts/", - }; -} |
