fix(post): render post.headline/subheadline when markdown body has no H1
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:
@@ -77,6 +77,15 @@
|
|||||||
<div class="content markdown max-w-none prose prose-zinc">
|
<div class="content markdown max-w-none prose prose-zinc">
|
||||||
{@html data.contentHeadlineHtml}
|
{@html data.contentHeadlineHtml}
|
||||||
</div>
|
</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}
|
||||||
{#if data.isEvent && (data.eventDateLabel || data.eventLocationText)}
|
{#if data.isEvent && (data.eventDateLabel || data.eventLocationText)}
|
||||||
<div class="mb-6">
|
<div class="mb-6">
|
||||||
|
|||||||
Reference in New Issue
Block a user