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) +})