aboutsummaryrefslogtreecommitdiff
path: root/src/utils/schemas/websiteSchema.ts
blob: 2f69427a747115091c224f3069222083569b0d62 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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,
});