fix: Added translated city name to meta title
Approved-by: Linus Flood Approved-by: Matilda Landström
This commit is contained in:
@@ -54,7 +54,7 @@ export async function getHotelPageDescription(data: RawMetadataSchema) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const hotelName = hotelData.name
|
const hotelName = hotelData.name
|
||||||
const location = hotelData.address.city
|
const location = hotelData.translatedCityName
|
||||||
const amenities = hotelData.detailedFacilities
|
const amenities = hotelData.detailedFacilities
|
||||||
|
|
||||||
if (amenities.length < 4) {
|
if (amenities.length < 4) {
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ export async function getTitle(data: RawMetadataSchema) {
|
|||||||
{
|
{
|
||||||
restaurantName: restaurantSubPage.name,
|
restaurantName: restaurantSubPage.name,
|
||||||
hotelName: data.hotelData.name,
|
hotelName: data.hotelData.name,
|
||||||
destination: data.hotelData.address.city,
|
destination: data.hotelData.translatedCityName,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
const restaurantTitleShort = intl.formatMessage(
|
const restaurantTitleShort = intl.formatMessage(
|
||||||
@@ -66,7 +66,7 @@ export async function getTitle(data: RawMetadataSchema) {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
hotelName: data.hotelData.name,
|
hotelName: data.hotelData.name,
|
||||||
destination: data.hotelData.address.city,
|
destination: data.hotelData.translatedCityName,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
const parkingTitleShort = intl.formatMessage(
|
const parkingTitleShort = intl.formatMessage(
|
||||||
@@ -86,7 +86,7 @@ export async function getTitle(data: RawMetadataSchema) {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
hotelName: data.hotelData.name,
|
hotelName: data.hotelData.name,
|
||||||
destination: data.hotelData.address.city,
|
destination: data.hotelData.translatedCityName,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
const wellnessTitleShort = intl.formatMessage(
|
const wellnessTitleShort = intl.formatMessage(
|
||||||
@@ -110,7 +110,7 @@ export async function getTitle(data: RawMetadataSchema) {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
hotelName: data.hotelData.name,
|
hotelName: data.hotelData.name,
|
||||||
destination: data.hotelData.address.city,
|
destination: data.hotelData.translatedCityName,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
const accessibilityTitleShort = intl.formatMessage(
|
const accessibilityTitleShort = intl.formatMessage(
|
||||||
@@ -134,7 +134,7 @@ export async function getTitle(data: RawMetadataSchema) {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
hotelName: data.hotelData.name,
|
hotelName: data.hotelData.name,
|
||||||
destination: data.hotelData.address.city,
|
destination: data.hotelData.translatedCityName,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
const meetingsTitleShort = intl.formatMessage(
|
const meetingsTitleShort = intl.formatMessage(
|
||||||
@@ -160,7 +160,7 @@ export async function getTitle(data: RawMetadataSchema) {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
hotelName: data.hotelData.name,
|
hotelName: data.hotelData.name,
|
||||||
destination: data.hotelData.address.city,
|
destination: data.hotelData.translatedCityName,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -114,11 +114,15 @@ export const rawMetadataSchema = z.object({
|
|||||||
hotelData: hotelAttributesSchema
|
hotelData: hotelAttributesSchema
|
||||||
.pick({
|
.pick({
|
||||||
name: true,
|
name: true,
|
||||||
address: true,
|
|
||||||
detailedFacilities: true,
|
detailedFacilities: true,
|
||||||
hotelContent: true,
|
hotelContent: true,
|
||||||
healthFacilities: true,
|
healthFacilities: true,
|
||||||
})
|
})
|
||||||
|
.merge(
|
||||||
|
z.object({
|
||||||
|
translatedCityName: z.string(),
|
||||||
|
})
|
||||||
|
)
|
||||||
.nullish(),
|
.nullish(),
|
||||||
additionalHotelData: additionalDataAttributesSchema
|
additionalHotelData: additionalDataAttributesSchema
|
||||||
.pick({
|
.pick({
|
||||||
|
|||||||
@@ -184,7 +184,11 @@ export const metadataQueryRouter = router({
|
|||||||
...hotelPageData,
|
...hotelPageData,
|
||||||
...(hotelData
|
...(hotelData
|
||||||
? {
|
? {
|
||||||
hotelData: hotelData.hotel,
|
hotelData: {
|
||||||
|
...hotelData.hotel,
|
||||||
|
translatedCityName:
|
||||||
|
hotelData.cities?.[0]?.name || hotelData.hotel.cityName,
|
||||||
|
},
|
||||||
additionalHotelData: hotelData.additionalData,
|
additionalHotelData: hotelData.additionalData,
|
||||||
hotelRestaurants: hotelData.restaurants,
|
hotelRestaurants: hotelData.restaurants,
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user