refactor: update schema handling and improve SEO metadata
RenovateBot / renovate (push) Successful in 26s
Test / npm test (push) Successful in 46s

- Changed schema type from WithContext<Thing> 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.
This commit is contained in:
2026-04-22 16:11:58 +00:00
parent 41bb309966
commit 5e818d804d
14 changed files with 227 additions and 101 deletions
+5 -4
View File
@@ -1,5 +1,5 @@
---
import type { WithContext, Thing } from "schema-dts";
import type { Thing } from "schema-dts";
import Analytics from "../components/Analytics.astro";
import Head from "../components/Head.astro";
import Header from "../components/Header.astro";
@@ -9,15 +9,16 @@ type Props = {
readonly description: string;
readonly lang: string;
readonly preview: string;
readonly schema: WithContext<Thing>;
readonly robots?: string;
readonly schema: Thing[];
readonly title: string;
};
const { description, lang, preview, schema, title } = Astro.props;
const { description, lang, preview, robots, schema, title } = Astro.props;
---
<html lang={lang}>
<Head title={title} description={description} preview={preview} schema={schema} />
<Head title={title} description={description} preview={preview} robots={robots} schema={schema} />
<body>
<main>