From bb9df1f9bd75b470f2c64913d255f4c7fd602a6a Mon Sep 17 00:00:00 2001 From: Peter Meier Date: Sat, 25 Apr 2026 09:22:18 +0200 Subject: [PATCH] fix(post): align microformat block with PostEntry types for svelte-check Three CI typecheck failures from the previous microformat patch: - post.created is the only date field in the schema (no _created on the generated PostEntry). Drop the _created fallback. - postTag items can be a slug string OR a tag object. Type narrowing with `'name' in tag` widened to `never`; pull the name through an explicit `{ name?: string }` cast in @const so the iteration stays honest about the runtime shape. - author isn't on PostEntry either; cast at the use-site for the hidden h-card author block. --- src/routes/post/[slug]/+page.svelte | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/routes/post/[slug]/+page.svelte b/src/routes/post/[slug]/+page.svelte index 6f1df9b..ee2e0f4 100644 --- a/src/routes/post/[slug]/+page.svelte +++ b/src/routes/post/[slug]/+page.svelte @@ -78,12 +78,12 @@ itemtype={data.isEvent ? 'https://schema.org/Event' : 'https://schema.org/BlogPosting'} > - {#if data.post._created || data.post.created} + {#if data.post.created} + >{data.post.created} {/if} {#if data.contentHeadlineHtml}
@@ -121,15 +121,19 @@ {/if} {#if (data.post.postTag ?? []).length > 0} {/if}