refactor: update schema handling and improve SEO metadata
- 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:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user