feat(publish): Frontmatter unterstützt a-tag-liste

This commit is contained in:
Jörg Lohrer 2026-04-21 09:16:26 +02:00
parent 66ff33e34a
commit 4986eae592
2 changed files with 22 additions and 0 deletions

View File

@ -32,6 +32,7 @@ export interface Frontmatter {
lang?: string
authors?: Author[]
images?: ImageEntry[]
a?: string[]
[key: string]: unknown
}

View File

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