From a81e6cf1267ea5ba17400e5783c904ac70a17980 Mon Sep 17 00:00:00 2001 From: SquidSpirit Date: Mon, 4 Aug 2025 13:02:34 +0800 Subject: [PATCH] BLOG-48 feat: add structured data component for improved SEO and metadata handling --- .../post/framework/ui/PostContentPage.svelte | 9 ++++++- .../post/framework/ui/StructuredData.svelte | 26 +++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 frontend/src/lib/post/framework/ui/StructuredData.svelte diff --git a/frontend/src/lib/post/framework/ui/PostContentPage.svelte b/frontend/src/lib/post/framework/ui/PostContentPage.svelte index 659f639..8bd038a 100644 --- a/frontend/src/lib/post/framework/ui/PostContentPage.svelte +++ b/frontend/src/lib/post/framework/ui/PostContentPage.svelte @@ -5,6 +5,7 @@ import markdownit from 'markdown-it'; import SafeHtml from '$lib/common/framework/ui/SafeHtml.svelte'; import generateTitle from '$lib/common/framework/ui/generateTitle'; + import StructuredData from '$lib/post/framework/ui/StructuredData.svelte'; const { id }: { id: number } = $props(); @@ -19,8 +20,14 @@ {generateTitle(state.data?.info.title)} - {#if state.data?.info.description} + {#if state.data} + {/if}
diff --git a/frontend/src/lib/post/framework/ui/StructuredData.svelte b/frontend/src/lib/post/framework/ui/StructuredData.svelte new file mode 100644 index 0000000..2aac4e8 --- /dev/null +++ b/frontend/src/lib/post/framework/ui/StructuredData.svelte @@ -0,0 +1,26 @@ + + +{@html `