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:
27
apps/scandic-web/app/layout.tsx
Normal file
27
apps/scandic-web/app/layout.tsx
Normal file
@@ -0,0 +1,27 @@
|
||||
import { getTitlePrefix } from "@/utils/metadata/title/getTitlePrefix"
|
||||
|
||||
import type { Metadata } from "next"
|
||||
|
||||
export async function generateMetadata(): Promise<Metadata> {
|
||||
return {
|
||||
title: {
|
||||
template: combineSegments([getTitlePrefix(), "%s", "Scandic Hotels"]),
|
||||
default: combineSegments([getTitlePrefix(), "Scandic Hotels"]),
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
export default async function RootLayout({
|
||||
children,
|
||||
}: {
|
||||
children: React.ReactNode
|
||||
}) {
|
||||
return <>{children}</>
|
||||
}
|
||||
|
||||
function combineSegments(
|
||||
segments: (string | null | undefined)[],
|
||||
delimiter = " | "
|
||||
) {
|
||||
return segments.filter(Boolean).join(delimiter).trim()
|
||||
}
|
||||
Reference in New Issue
Block a user