From 4986eae592f0db63ccf74ecd408be6150284f8a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Lohrer?= Date: Tue, 21 Apr 2026 09:16:26 +0200 Subject: [PATCH] =?UTF-8?q?feat(publish):=20Frontmatter=20unterst=C3=BCtzt?= =?UTF-8?q?=20a-tag-liste?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- publish/src/core/frontmatter.ts | 1 + publish/tests/frontmatter_test.ts | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/publish/src/core/frontmatter.ts b/publish/src/core/frontmatter.ts index d30c2d1..1dd0314 100644 --- a/publish/src/core/frontmatter.ts +++ b/publish/src/core/frontmatter.ts @@ -32,6 +32,7 @@ export interface Frontmatter { lang?: string authors?: Author[] images?: ImageEntry[] + a?: string[] [key: string]: unknown } diff --git a/publish/tests/frontmatter_test.ts b/publish/tests/frontmatter_test.ts index bf01b8f..e7475f3 100644 --- a/publish/tests/frontmatter_test.ts +++ b/publish/tests/frontmatter_test.ts @@ -25,3 +25,24 @@ Deno.test('parseFrontmatter: erhält Leerzeichen in String-Werten', () => { const { fm } = parseFrontmatter(md) assertEquals(fm.title, 'Hello World') }) + +Deno.test('parseFrontmatter: liest a-tag-liste aus frontmatter', () => { + const md = [ + '---', + 'title: T', + 'slug: s', + 'date: 2024-01-01', + 'a:', + ' - "30023:abc:other-slug"', + '---', + 'body', + ].join('\n') + const { fm } = parseFrontmatter(md) + assertEquals(fm.a, ['30023:abc:other-slug']) +}) + +Deno.test('parseFrontmatter: a fehlt → undefined', () => { + const md = '---\ntitle: T\nslug: s\ndate: 2024-01-01\n---\nbody' + const { fm } = parseFrontmatter(md) + assertEquals(fm.a, undefined) +})