fix(andreknie.de): normalize SEO metadata and document structure

This commit is contained in:
2026-07-28 21:42:54 +02:00
parent b507199987
commit 215aacf4a4
21 changed files with 161 additions and 33 deletions
@@ -25,7 +25,7 @@ function readContentDir(subdir) {
return {
...data,
slug,
body: marked(content),
body: renderMarkdownContent(content),
_source: `${subdir}/${filename}`
}
}
@@ -41,6 +41,18 @@ function readContentDir(subdir) {
.filter(Boolean)
}
export function renderMarkdownContent(content) {
const tokens = marked.lexer(content)
const firstContentToken = tokens.findIndex(token => token.type !== 'space')
const firstToken = tokens[firstContentToken]
if (firstToken?.type === 'heading' && firstToken.depth === 1) {
tokens.splice(firstContentToken, 1)
}
return marked.parser(tokens)
}
function readMetaFile(filename) {
const filepath = join(CONTENT_DIR, 'meta', filename)
if (!existsSync(filepath)) return null