diff options
Diffstat (limited to 'nuldoc-src/config.ts')
| -rw-r--r-- | nuldoc-src/config.ts | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/nuldoc-src/config.ts b/nuldoc-src/config.ts index cbbabca..76a05fe 100644 --- a/nuldoc-src/config.ts +++ b/nuldoc-src/config.ts @@ -33,3 +33,10 @@ export const config = { }; export type Config = typeof config; + +export function getTagLabel(c: Config, slug: string): string { + if (!(slug in c.blog.tagLabels)) { + throw new Error(`Unknown tag: ${slug}`); + } + return (c.blog.tagLabels as { [slug: string]: string })[slug]; +} |
