From 2e135352d0b3662ef44336994465ec7d75d400f1 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sun, 25 Jun 2023 18:20:53 +0900 Subject: feat(nuldoc): improve error handling when a tag is undefined --- nuldoc-src/pages/tag.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'nuldoc-src/pages/tag.ts') diff --git a/nuldoc-src/pages/tag.ts b/nuldoc-src/pages/tag.ts index cb60d21..f501cb3 100644 --- a/nuldoc-src/pages/tag.ts +++ b/nuldoc-src/pages/tag.ts @@ -3,7 +3,7 @@ import { globalHeader } from "../components/global_header.ts"; import { pageLayout } from "../components/page_layout.ts"; import { postPageEntry } from "../components/post_page_entry.ts"; import { slidePageEntry } from "../components/slide_page_entry.ts"; -import { Config } from "../config.ts"; +import { Config, getTagLabel } from "../config.ts"; import { el, text } from "../dom.ts"; import { Page } from "../page.ts"; import { getPostCreatedDate } from "./post.ts"; @@ -19,8 +19,7 @@ export async function generateTagPage( pages: TaggedPage[], config: Config, ): Promise { - const tagLabel = - (config.blog.tagLabels as { [key: string]: string })[tagSlug]; + const tagLabel = getTagLabel(config, tagSlug); const pageTitle = `タグ「${tagLabel}」一覧`; const body = el( -- cgit v1.2.3-70-g09d2