diff options
Diffstat (limited to 'src/utils/schemas/blogSchema.ts')
-rw-r--r-- | src/utils/schemas/blogSchema.ts | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/utils/schemas/blogSchema.ts b/src/utils/schemas/blogSchema.ts new file mode 100644 index 0000000..7ff84d8 --- /dev/null +++ b/src/utils/schemas/blogSchema.ts @@ -0,0 +1,13 @@ +import type { WithContext, Blog } from "schema-dts"; + +export type BlogSchemaParams = { + readonly siteUrl: string; + readonly title: string; +}; + +export default ({ siteUrl, title }: BlogSchemaParams): WithContext<Blog> => ({ + "@context": "https://schema.org", + "@type": "Blog", + "url": new URL("/blog/", siteUrl).toString(), + "name": title, +}); |