- 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.
24 lines
667 B
TypeScript
24 lines
667 B
TypeScript
import type { WebSite } from "schema-dts";
|
|
import { config } from "../../config";
|
|
import { personId, websiteId } from "./ids";
|
|
|
|
export type WebsiteSchemaParams = {
|
|
readonly description: string;
|
|
readonly lang: string;
|
|
readonly name: string;
|
|
readonly siteUrl: string;
|
|
};
|
|
|
|
export default ({ siteUrl, name, description, lang }: WebsiteSchemaParams): WebSite => ({
|
|
"@type": "WebSite",
|
|
"@id": websiteId(siteUrl),
|
|
"url": siteUrl,
|
|
"name": name,
|
|
"description": description,
|
|
"inLanguage": lang,
|
|
"publisher": { "@id": personId(siteUrl) },
|
|
"author": { "@id": personId(siteUrl) },
|
|
"copyrightHolder": { "@id": personId(siteUrl) },
|
|
"sameAs": config.author.sameAs,
|
|
});
|