fix(post): render post.headline/subheadline when markdown body has no H1
Deploy / verify (push) Successful in 49s
Deploy / deploy (push) Successful in 1m6s

The article template only rendered the H1 it could pluck from the
markdown body (`contentHeadlineHtml`). Posts whose body opens with H2
(or no heading) silently lost both the schema-level `headline` and
`subheadline` — they were used in SEO/JSON-LD/breadcrumb only.

Fall back to the structured fields when no inline H1 is present.
This commit is contained in:
Peter Meier
2026-04-24 08:30:50 +02:00
parent 724b75b6bf
commit 36288befe1
+9
View File
@@ -77,6 +77,15 @@
<div class="content markdown max-w-none prose prose-zinc">
{@html data.contentHeadlineHtml}
</div>
{:else if data.post.headline || data.post.subheadline}
<header class="content markdown max-w-none prose prose-zinc mb-4">
{#if data.post.headline}
<h1>{data.post.headline}</h1>
{/if}
{#if data.post.subheadline}
<p class="text-zinc-600 lead">{data.post.subheadline}</p>
{/if}
</header>
{/if}
{#if data.isEvent && (data.eventDateLabel || data.eventLocationText)}
<div class="mb-6">