feat(SW-201): Added structured data for hotel pages
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { z } from "zod"
|
||||
|
||||
import { hotelAttributesSchema } from "../../hotels/output"
|
||||
import { tempImageVaultAssetSchema } from "../schemas/imageVault"
|
||||
import { getDescription, getImage, getTitle } from "./utils"
|
||||
|
||||
@@ -72,13 +73,8 @@ export const rawMetadataSchema = z.object({
|
||||
hero_image: tempImageVaultAssetSchema.nullable(),
|
||||
blocks: metaDataBlocksSchema,
|
||||
hotel_page_id: z.string().optional().nullable(),
|
||||
hotelData: z
|
||||
.object({
|
||||
name: z.string(),
|
||||
city: z.string(),
|
||||
description: z.string(),
|
||||
image: z.object({ url: z.string(), alt: z.string() }).nullable(),
|
||||
})
|
||||
hotelData: hotelAttributesSchema
|
||||
.pick({ name: true, address: true, hotelContent: true, gallery: true })
|
||||
.optional()
|
||||
.nullable(),
|
||||
})
|
||||
@@ -88,7 +84,7 @@ export const metadataSchema = rawMetadataSchema.transform(async (data) => {
|
||||
|
||||
const metadata: Metadata = {
|
||||
title: await getTitle(data),
|
||||
description: await getDescription(data),
|
||||
description: getDescription(data),
|
||||
openGraph: {
|
||||
images: getImage(data),
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user