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.ts13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/utils/schemas/websiteSchema.ts b/src/utils/schemas/websiteSchema.ts
new file mode 100644
index 0000000..bebb963
--- /dev/null
+++ b/src/utils/schemas/websiteSchema.ts
@@ -0,0 +1,13 @@
+import type { WithContext, WebSite } from "schema-dts";
+
+export type WebsiteSchemaParams = {
+ readonly siteUrl: string;
+ readonly title: string;
+};
+
+export default ({ siteUrl, title }: WebsiteSchemaParams): WithContext<WebSite> => ({
+ "@context": "https://schema.org",
+ "@type": "WebSite",
+ "url": new URL("/", siteUrl).toString(),
+ "name": title,
+});