diff --git a/app/[[...path]]/page.tsx b/app/[[...path]]/page.tsx index bdc4e5d1e8d38..98ae8edae9b51 100644 --- a/app/[[...path]]/page.tsx +++ b/app/[[...path]]/page.tsx @@ -19,7 +19,7 @@ import {isDeveloperDocs} from 'sentry-docs/isDeveloperDocs'; import {getDevDocsFrontMatter, getDocsFrontMatter, getFileBySlug} from 'sentry-docs/mdx'; import {mdxComponents} from 'sentry-docs/mdxComponents'; import {setServerContext} from 'sentry-docs/serverContext'; -import {capitilize} from 'sentry-docs/utils'; +import {formatGuideOrPlatformTitle} from 'sentry-docs/utils'; export async function generateStaticParams() { const docs = await (isDeveloperDocs ? getDevDocsFrontMatter() : getDocsFrontMatter()); @@ -141,7 +141,9 @@ export async function generateMetadata({params}: MetadataProps): Promise { return str.charAt(0).toUpperCase() + str.slice(1); }; +export const formatGuideOrPlatformTitle = (title: string) => { + const lowerCase = title.toLowerCase(); + if (lowerCase === 'ios') { + return 'iOS'; + } + + if (lowerCase === 'macos') { + return 'macOS'; + } + + if (lowerCase === 'tvos') { + return 'tvOS'; + } + + if (lowerCase === 'visionos') { + return 'visionOS'; + } + + if (lowerCase === 'watchos') { + return 'watchOS'; + } + + return capitilize(title); +}; + export const uniqByReference = (arr: T[]): T[] => Array.from(new Set(arr)); export const splitToChunks = (numChunks: number, arr: T[]): T[][] => {