From 5e818d804d5d38beff0f3754a006333752fd5082 Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Wed, 22 Apr 2026 16:11:58 +0000 Subject: refactor: update schema handling and improve SEO metadata - Changed schema type from WithContext to Thing[] in Head, BaseLayout, and JsonLd components for better flexibility. - Added optional robots meta tag to Head component. - Updated JSON-LD generation in JsonLd component to include a structured payload. - Enhanced page and blog schemas to support breadcrumb and person schemas for improved SEO. - Introduced new utility schemas for website and person to streamline schema generation. - Refactored existing schemas to align with the new structure and ensure consistency across components. --- src/components/Head.astro | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/components/Head.astro') diff --git a/src/components/Head.astro b/src/components/Head.astro index 3fded95..258162d 100644 --- a/src/components/Head.astro +++ b/src/components/Head.astro @@ -1,15 +1,16 @@ --- -import type { WithContext, Thing } from "schema-dts"; +import type { Thing } from "schema-dts"; import JsonLd from "./JsonLd.astro"; type Props = { readonly description: string; readonly preview: string; - readonly schema: WithContext; + readonly robots?: string; + readonly schema: Thing[]; readonly title: string; }; -const { description, preview, schema, title } = Astro.props; +const { description, preview, robots = "index, follow", schema, title } = Astro.props; const canonicalUrl = new URL(Astro.url.pathname, Astro.site); const previewUrl = new URL(preview, Astro.site); @@ -21,7 +22,7 @@ const previewUrl = new URL(preview, Astro.site); - + -- cgit v1.2.3