aboutsummaryrefslogtreecommitdiff
path: root/src/utils/schemas/blogPostSchema.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils/schemas/blogPostSchema.ts')
-rw-r--r--src/utils/schemas/blogPostSchema.ts4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/utils/schemas/blogPostSchema.ts b/src/utils/schemas/blogPostSchema.ts
index 00395dd..9445448 100644
--- a/src/utils/schemas/blogPostSchema.ts
+++ b/src/utils/schemas/blogPostSchema.ts
@@ -5,13 +5,14 @@ export type BlogPostSchemaParams = {
readonly dateModified: string;
readonly datePublished: string;
readonly description: string;
+ readonly isBasedOn?: string;
readonly lang: string;
readonly siteUrl: string;
readonly slug: string;
readonly title: string;
};
-export default ({ siteUrl, slug, title, description, datePublished, dateModified, author, lang }: BlogPostSchemaParams): WithContext<BlogPosting> => ({
+export default ({ siteUrl, slug, title, description, datePublished, dateModified, author, lang, isBasedOn }: BlogPostSchemaParams): WithContext<BlogPosting> => ({
"@context": "https://schema.org",
"@type": "BlogPosting",
"url": new URL(`/blog/${slug}`, siteUrl).toString(),
@@ -28,4 +29,5 @@ export default ({ siteUrl, slug, title, description, datePublished, dateModified
"@type": "WebPage",
"@id": new URL(`/blog/${slug}`, siteUrl).toString(),
},
+ ...(isBasedOn && { isBasedOn: isBasedOn }),
});