Skip to content

Commit

Permalink
fix iamges for all pages
Browse files Browse the repository at this point in the history
  • Loading branch information
Dujota committed Nov 23, 2024
1 parent eb76a81 commit ee0ba0e
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions lib/seo/homepageStructuredData.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { urlForImage } from 'lib/sanity.image';

import { Post } from './blogStructuredData';
import { Listing } from './structuredData';

Expand Down Expand Up @@ -38,8 +40,8 @@ function createFeaturedItems(items: Listing[], type: 'listing' | 'rental' | 'vac
...(item.excerpt && {
description: item.excerpt,
}),
...(item.coverImage?.asset?.url && {
image: item.coverImage.asset.url,
...(item.coverImage && {
image: urlForImage(item.coverImage).url(),
}),
...(item.price && {
offers: {
Expand All @@ -63,14 +65,14 @@ function createFeaturedItems(items: Listing[], type: 'listing' | 'rental' | 'vac
floorSize: {
'@type': 'QuantitativeValue',
value: item.area,
unitCode: 'SQF',
unitCode: 'MKT',
},
}),
...(item.landArea && {
lotSize: {
'@type': 'QuantitativeValue',
value: item.landArea,
unitCode: 'SQF',
unitCode: 'MKT',
},
}),
...((item.bedrooms || item.bathrooms) && {
Expand All @@ -93,8 +95,8 @@ function createFeaturedBlogPosts(posts: Post[]) {
headline: post.title,
url: `${baseUrl}/blog/${post.slug}`,
description: post.excerpt,
...(post.coverImage?.asset?.url && {
image: post.coverImage.asset.url,
...(post.coverImage && {
image: urlForImage(post.coverImage).url(),
}),
datePublished: post.date,
...(post.author && {
Expand Down

0 comments on commit ee0ba0e

Please sign in to comment.