Merged in SW-3490-set-metadata-for-routes (pull request #2881)
SW-3490 set metadata for routes * feat(SW-3490): Set metadata title for hotelreservation paths Approved-by: Anton Gunnarsson
This commit is contained in:
@@ -4,8 +4,7 @@ import type { RawMetadataSchema } from "@scandic-hotels/trpc/routers/contentstac
|
||||
|
||||
export async function getDestinationPageTitle(
|
||||
data: RawMetadataSchema,
|
||||
pageType: "city" | "country",
|
||||
suffix: string
|
||||
pageType: "city" | "country"
|
||||
) {
|
||||
const intl = await getIntl()
|
||||
const { destinationData } = data
|
||||
@@ -33,13 +32,10 @@ export async function getDestinationPageTitle(
|
||||
{ location }
|
||||
)
|
||||
|
||||
return `${destinationTitle}${suffix}`
|
||||
return destinationTitle
|
||||
}
|
||||
|
||||
export function getDestinationFilterSeoMetaTitle(
|
||||
data: RawMetadataSchema,
|
||||
suffix: string
|
||||
) {
|
||||
export function getDestinationFilterSeoMetaTitle(data: RawMetadataSchema) {
|
||||
const filter = data.destinationData?.filter
|
||||
|
||||
if (!filter) {
|
||||
@@ -51,10 +47,10 @@ export function getDestinationFilterSeoMetaTitle(
|
||||
|
||||
if (foundSeoFilter) {
|
||||
if (foundSeoFilter.seo_metadata?.title) {
|
||||
return `${foundSeoFilter.seo_metadata.title}${suffix}`
|
||||
return foundSeoFilter.seo_metadata.title
|
||||
}
|
||||
|
||||
return `${foundSeoFilter.heading}${suffix}`
|
||||
return foundSeoFilter.heading
|
||||
}
|
||||
|
||||
return null
|
||||
|
||||
Reference in New Issue
Block a user