diff options
Diffstat (limited to 'nuldoc-src/pages')
| -rw-r--r-- | nuldoc-src/pages/post.ts | 10 | ||||
| -rw-r--r-- | nuldoc-src/pages/slide.ts | 10 | ||||
| -rw-r--r-- | nuldoc-src/pages/tag.ts | 5 |
3 files changed, 8 insertions, 17 deletions
diff --git a/nuldoc-src/pages/post.ts b/nuldoc-src/pages/post.ts index d870e99..24a6d5f 100644 --- a/nuldoc-src/pages/post.ts +++ b/nuldoc-src/pages/post.ts @@ -2,7 +2,7 @@ import { join } from "std/path/mod.ts"; import { globalFooter } from "../components/global_footer.ts"; import { globalHeader } from "../components/global_header.ts"; import { pageLayout } from "../components/page_layout.ts"; -import { Config } from "../config.ts"; +import { Config, getTagLabel } from "../config.ts"; import { el, Element, text } from "../dom.ts"; import { Document } from "../docbook/document.ts"; import { Page } from "../page.ts"; @@ -57,9 +57,7 @@ export async function generatePostPage( "a", [["href", `/tags/${slug}/`]], text( - (config.blog.tagLabels as { - [key: string]: string; - })[slug], + getTagLabel(config, slug), ), ), ) @@ -115,9 +113,7 @@ export async function generatePostPage( { metaCopyrightYear: getPostCreatedDate(doc).year, metaDescription: doc.summary, - metaKeywords: doc.tags.map((slug) => - (config.blog.tagLabels as { [key: string]: string })[slug] - ), + metaKeywords: doc.tags.map((slug) => getTagLabel(config, slug)), metaTitle: `${doc.title} | ${config.blog.siteName}`, requiresSyntaxHighlight: true, }, diff --git a/nuldoc-src/pages/slide.ts b/nuldoc-src/pages/slide.ts index e5f40a0..a75aeb6 100644 --- a/nuldoc-src/pages/slide.ts +++ b/nuldoc-src/pages/slide.ts @@ -3,7 +3,7 @@ import { globalFooter } from "../components/global_footer.ts"; import { globalHeader } from "../components/global_header.ts"; import { pageLayout } from "../components/page_layout.ts"; import { staticScriptElement } from "../components/utils.ts"; -import { Config } from "../config.ts"; +import { Config, getTagLabel } from "../config.ts"; import { el, text } from "../dom.ts"; import { Page } from "../page.ts"; import { dateToString, Revision } from "../revision.ts"; @@ -53,9 +53,7 @@ export async function generateSlidePage( "a", [["href", `/tags/${slug}/`]], text( - (config.blog.tagLabels as { - [key: string]: string; - })[slug], + getTagLabel(config, slug), ), ), ) @@ -113,9 +111,7 @@ export async function generateSlidePage( { metaCopyrightYear: getPostCreatedDate(slide).year, metaDescription: slide.title, - metaKeywords: slide.tags.map((slug) => - (config.blog.tagLabels as { [key: string]: string })[slug] - ), + metaKeywords: slide.tags.map((slug) => getTagLabel(config, slug)), metaTitle: `${slide.event} (${slide.talkType}) | ${config.blog.siteName}`, requiresSyntaxHighlight: true, }, 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<TagPage> { - const tagLabel = - (config.blog.tagLabels as { [key: string]: string })[tagSlug]; + const tagLabel = getTagLabel(config, tagSlug); const pageTitle = `タグ「${tagLabel}」一覧`; const body = el( |
