From 6dedddc545e2f1930bdc2256784eb1551bd4231d Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sun, 1 Feb 2026 00:49:15 +0900 Subject: feat(nuldoc): rewrite nuldoc in Ruby --- services/nuldoc/nuldoc-src/config.ts | 52 ------------------------------------ 1 file changed, 52 deletions(-) delete mode 100644 services/nuldoc/nuldoc-src/config.ts (limited to 'services/nuldoc/nuldoc-src/config.ts') diff --git a/services/nuldoc/nuldoc-src/config.ts b/services/nuldoc/nuldoc-src/config.ts deleted file mode 100644 index 267a8f99..00000000 --- a/services/nuldoc/nuldoc-src/config.ts +++ /dev/null @@ -1,52 +0,0 @@ -import { join } from "@std/path"; -import { parse as parseToml } from "@std/toml"; -import { z } from "zod/mod.ts"; - -const ConfigSchema = z.object({ - locations: z.object({ - contentDir: z.string(), - destDir: z.string(), - staticDir: z.string(), - }), - site: z.object({ - author: z.string(), - copyrightYear: z.number(), - }), - sites: z.object({ - default: z.object({ - fqdn: z.string(), - siteName: z.string(), - }), - about: z.object({ - fqdn: z.string(), - siteName: z.string(), - }), - blog: z.object({ - fqdn: z.string(), - siteName: z.string(), - postsPerPage: z.number(), - }), - slides: z.object({ - fqdn: z.string(), - siteName: 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.tagLabels)) { - throw new Error(`Unknown tag: ${slug}`); - } - return c.tagLabels[slug]; -} - -export function getDefaultConfigPath(): string { - return join(Deno.cwd(), "nuldoc.toml"); -} - -export async function loadConfig(filePath: string): Promise { - return ConfigSchema.parse(parseToml(await Deno.readTextFile(filePath))); -} -- cgit v1.3-1-g0d28