From 25ebd94466edcf87c675a12e3cf80b0ce572ab76 Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Sat, 14 Jun 2025 12:12:16 +0000 Subject: refactor: remove preview property from blog post schema and configuration - Eliminated the optional `preview` field from the blog post schema and configuration to streamline data handling. - Updated the blog post schema to utilize the default image directly from configuration, enhancing consistency in image representation. --- src/utils/schemas/blogPostSchema.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/utils') diff --git a/src/utils/schemas/blogPostSchema.ts b/src/utils/schemas/blogPostSchema.ts index 4bf50f2..9e43478 100644 --- a/src/utils/schemas/blogPostSchema.ts +++ b/src/utils/schemas/blogPostSchema.ts @@ -7,19 +7,18 @@ export type BlogPostSchemaParams = { readonly description: string; readonly isBasedOn?: string; readonly lang: string; - readonly preview?: string; readonly siteUrl: string; readonly slug: string; readonly title: string; }; -export default ({ siteUrl, slug, title, description, preview, datePublished, dateModified, lang, isBasedOn }: BlogPostSchemaParams): WithContext => ({ +export default ({ siteUrl, slug, title, description, datePublished, dateModified, lang, isBasedOn }: BlogPostSchemaParams): WithContext => ({ "@context": "https://schema.org", "@type": "BlogPosting", "url": new URL(`/blog/${slug}`, siteUrl).toString(), "headline": title, "description": description, - "image": new URL(preview ? preview : config.posts.defaultImage, siteUrl).toString(), + "image": new URL(config.posts.defaultImage, siteUrl).toString(), "datePublished": datePublished, "dateModified": dateModified, "inLanguage": lang, -- cgit v1.2.3