2025-06-11 23:20:36 +00:00
|
|
|
import type { WithContext, WebSite } from "schema-dts";
|
|
|
|
|
|
|
|
export type WebsiteSchemaParams = {
|
2025-06-14 11:25:17 +00:00
|
|
|
readonly description: string;
|
2025-06-11 23:20:36 +00:00
|
|
|
readonly siteUrl: string;
|
|
|
|
readonly title: string;
|
|
|
|
};
|
|
|
|
|
2025-06-14 11:25:17 +00:00
|
|
|
export default ({ siteUrl, title, description }: WebsiteSchemaParams): WithContext<WebSite> => ({
|
2025-06-11 23:20:36 +00:00
|
|
|
"@context": "https://schema.org",
|
|
|
|
"@type": "WebSite",
|
|
|
|
"url": new URL("/", siteUrl).toString(),
|
|
|
|
"name": title,
|
2025-06-14 11:25:17 +00:00
|
|
|
"description": description,
|
2025-06-11 23:20:36 +00:00
|
|
|
});
|