feat(SW-201): Added structured data for hotel pages

This commit is contained in:
Erik Tiekstra
2024-11-18 15:47:28 +01:00
parent ca2f60253f
commit bab7c15424
12 changed files with 137 additions and 83 deletions

View File

@@ -153,26 +153,10 @@ export const metadataQueryRouter = router({
)
: null
const rawHotelData = hotelPageData
if (hotelData?.data.attributes) {
const attributes = hotelData.data.attributes
const images = attributes.gallery?.smallerImages
rawHotelData.hotelData = {
name: attributes.name,
city: attributes.cityName,
description: attributes.hotelContent.texts.descriptions.short,
image: images?.length
? {
url: images[0].imageSizes.small,
alt: images[0].metaData.altText,
}
: null,
}
}
return getTransformedMetadata(rawHotelData)
return getTransformedMetadata({
...hotelPageData,
hotelData: hotelData?.data.attributes,
})
default:
return null
}