Add release version meta tag + preview environment * include release version in meta tag do polyfills in one place * fix: add preview as a named sentry environment Approved-by: Linus Flood
35 lines
772 B
TypeScript
35 lines
772 B
TypeScript
import "@scandic-hotels/common/polyfills"
|
|
|
|
import { env } from "@/env/server"
|
|
|
|
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"]),
|
|
},
|
|
other: {
|
|
"x-release": env.RELEASE_TAG || "-",
|
|
},
|
|
}
|
|
}
|
|
|
|
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()
|
|
}
|