Tighten social metadata generation

This commit is contained in:
Meta Vens 2026-05-01 15:02:07 +01:00
commit bc3cf9691f
5 changed files with 57 additions and 8 deletions

View file

@ -63,7 +63,11 @@ function getFirstMarkdownHeading(root: MdRoot): string | undefined {
return toString(node).trim().length > 0
})
if (!firstMeaningfulNode || firstMeaningfulNode.type !== "heading") {
if (
!firstMeaningfulNode ||
firstMeaningfulNode.type !== "heading" ||
firstMeaningfulNode.depth !== 1
) {
return undefined
}