aboutsummaryrefslogtreecommitdiffhomepage
path: root/nuldoc-src/pages/slide.ts
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2023-06-25 18:20:53 +0900
committernsfisis <nsfisis@gmail.com>2023-06-25 18:25:31 +0900
commit2e135352d0b3662ef44336994465ec7d75d400f1 (patch)
treeb8b16c6d6c519c0f9854691fb99b2c40e632311c /nuldoc-src/pages/slide.ts
parent85bdb29b8dfbf6027fc2f98289433e254ec6ff50 (diff)
downloadblog.nsfisis.dev-2e135352d0b3662ef44336994465ec7d75d400f1.tar.gz
blog.nsfisis.dev-2e135352d0b3662ef44336994465ec7d75d400f1.tar.zst
blog.nsfisis.dev-2e135352d0b3662ef44336994465ec7d75d400f1.zip
feat(nuldoc): improve error handling when a tag is undefined
Diffstat (limited to 'nuldoc-src/pages/slide.ts')
-rw-r--r--nuldoc-src/pages/slide.ts10
1 files changed, 3 insertions, 7 deletions
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,
},