diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte
index ee9cdae..dd7e573 100644
--- a/src/routes/+layout.svelte
+++ b/src/routes/+layout.svelte
@@ -52,6 +52,14 @@
seoTitle?: string;
seoDescription?: string;
socialImage?: string;
+ ogType?: string;
+ ogImageAlt?: string;
+ articlePublishedTime?: string | null;
+ articleModifiedTime?: string | null;
+ articleAuthor?: string | null;
+ articleTags?: string[];
+ twitterLabel1?: string;
+ twitterData1?: string;
robots?: string;
keywords?: string;
preview?: boolean;
@@ -218,7 +226,7 @@
{/if}
-
+
{#if seoDescription}
@@ -228,9 +236,24 @@
+ {#if pageData?.ogImageAlt}
+
+ {/if}
{/if}
+ {#if pageData?.articlePublishedTime}
+
+ {/if}
+ {#if pageData?.articleModifiedTime}
+
+ {/if}
+ {#if pageData?.articleAuthor}
+
+ {/if}
+ {#each pageData?.articleTags ?? [] as tag}
+
+ {/each}
@@ -240,6 +263,13 @@
{/if}
{#if socialImageUrl}
+ {#if pageData?.ogImageAlt}
+
+ {/if}
+ {/if}
+ {#if pageData?.twitterLabel1 && pageData?.twitterData1}
+
+
{/if}
{@html jsonLdScript}
diff --git a/src/routes/post/[slug]/+page.server.ts b/src/routes/post/[slug]/+page.server.ts
index 8074795..5c466ea 100644
--- a/src/routes/post/[slug]/+page.server.ts
+++ b/src/routes/post/[slug]/+page.server.ts
@@ -303,13 +303,22 @@ export const load: PageServerLoad = async ({ params, locals, url, setHeaders })
translations,
seoTitle: post.seoTitle ?? postHeadline,
seoDescription: postDescription,
- socialImage: postSocialImageAbs ?? postImageUrl ?? undefined,
+ socialImage: postSocialImageAbs ?? undefined,
+ ogType: 'article' as const,
+ ogImageAlt: postHeadline,
+ articlePublishedTime: postCreated,
+ articleModifiedTime: postUpdated,
+ articleAuthor: postAuthor ?? siteName,
+ articleTags: (() => {
+ const tags = (post as { postTag?: Array<{ name?: string }> }).postTag ?? [];
+ return tags.map((t) => (typeof t === 'string' ? t : (t?.name ?? ''))).filter(Boolean);
+ })(),
+ twitterLabel1: 'Lesezeit',
+ twitterData1: `${readingTimeMinutes} Min.`,
robots: (post as { seoMetaRobots?: string }).seoMetaRobots ?? undefined,
keywords: (() => {
const explicit = ((post as { seoKeywords?: string }).seoKeywords ?? '').trim();
if (explicit) return explicit;
- // Fallback: join tag names so published posts without explicit keywords
- // still ship a meaningful .
const tags = (post as { postTag?: Array<{ name?: string }> }).postTag ?? [];
const names = tags
.map((t) => (typeof t?.name === 'string' ? t.name.trim() : ''))
diff --git a/src/routes/post/[slug]/+page.svelte b/src/routes/post/[slug]/+page.svelte
index d15d46b..77bc5d0 100644
--- a/src/routes/post/[slug]/+page.svelte
+++ b/src/routes/post/[slug]/+page.svelte
@@ -14,15 +14,6 @@
let { data }: { data: PageData } = $props();
-