aboutsummaryrefslogtreecommitdiff
path: root/src/utils/schemas/websiteSchema.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils/schemas/websiteSchema.ts')
-rw-r--r--src/utils/schemas/websiteSchema.ts23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/utils/schemas/websiteSchema.ts b/src/utils/schemas/websiteSchema.ts
new file mode 100644
index 0000000..2f69427
--- /dev/null
+++ b/src/utils/schemas/websiteSchema.ts
@@ -0,0 +1,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,
+});