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
42 lines
866 B
TypeScript
42 lines
866 B
TypeScript
import "@scandic-hotels/common/polyfills"
|
|
|
|
import { env } from "@/env/server"
|
|
import { configureTrpc } from "@/lib/trpc"
|
|
|
|
import { getTitlePrefix } from "@/util/metadata/getTitlePrfiex"
|
|
|
|
import type { Metadata } from "next"
|
|
|
|
configureTrpc()
|
|
|
|
export async function generateMetadata(): Promise<Metadata> {
|
|
return {
|
|
title: {
|
|
template: combineSegments([
|
|
getTitlePrefix(),
|
|
"%s",
|
|
"SAS by Scandic Hotels",
|
|
]),
|
|
default: combineSegments([getTitlePrefix(), "SAS by Scandic Hotels"]),
|
|
},
|
|
other: {
|
|
"x-release": env.RELEASE_TAG || "-",
|
|
},
|
|
}
|
|
}
|
|
|
|
export default function RootLayout({
|
|
children,
|
|
}: {
|
|
children: React.ReactNode
|
|
}) {
|
|
return <>{children}</>
|
|
}
|
|
|
|
function combineSegments(
|
|
segments: (string | null | undefined)[],
|
|
delimiter = " | "
|
|
) {
|
|
return segments.filter(Boolean).join(delimiter).trim()
|
|
}
|