From 83b1286354e0f5e83927c8fb35a584e587b5530b Mon Sep 17 00:00:00 2001 From: nsfisis Date: Thu, 27 Nov 2025 06:29:01 +0900 Subject: refactor(nuldoc): Refactor elem() --- services/nuldoc/nuldoc-src/config.ts | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'services/nuldoc/nuldoc-src/config.ts') diff --git a/services/nuldoc/nuldoc-src/config.ts b/services/nuldoc/nuldoc-src/config.ts index 95d7941..267a8f9 100644 --- a/services/nuldoc/nuldoc-src/config.ts +++ b/services/nuldoc/nuldoc-src/config.ts @@ -8,11 +8,6 @@ const ConfigSchema = z.object({ destDir: z.string(), staticDir: z.string(), }), - rendering: z.object({ - html: z.object({ - indentWidth: z.number(), - }), - }), site: z.object({ author: z.string(), copyrightYear: z.number(), @@ -29,25 +24,23 @@ const ConfigSchema = z.object({ blog: z.object({ fqdn: z.string(), siteName: z.string(), + postsPerPage: z.number(), }), slides: z.object({ fqdn: z.string(), siteName: z.string(), }), }), - blog: z.object({ - postsPerPage: z.number().default(10), - tagLabels: z.record(z.string(), z.string()), - }), + tagLabels: z.record(z.string(), z.string()), }); export type Config = z.infer; export function getTagLabel(c: Config, slug: string): string { - if (!(slug in c.blog.tagLabels)) { + if (!(slug in c.tagLabels)) { throw new Error(`Unknown tag: ${slug}`); } - return c.blog.tagLabels[slug]; + return c.tagLabels[slug]; } export function getDefaultConfigPath(): string { -- cgit v1.2.3-70-g09d2