chore: App-router-migration /auth/error, /auth/platform, /auth/oauth2 (#16445)

* preparePageMetadata: improve logic for title

* add missing pages: oauth2 / platform

* auth/error: add to app router and extract to /modules
This commit is contained in:
Benny Joo authored and GitHub committed 2024-09-04 13:15:19 +00:00
1 parent 86cf8feb55
commit 26be88fc56
11 files changed
+429 -354

No files matched your search

+4 -3
View File
@@ -67,10 +67,11 @@ export const prepareRootMetadata = (recipe: RootMetadataRecipe): Metadata => ({
});
export const preparePageMetadata = (recipe: PageMetadataRecipe): Metadata => {
const { title, description } = recipe;
const titleSuffix = `| ${APP_NAME}`;
const { description } = recipe;
return {
title: recipe.title.includes(titleSuffix) ? recipe.title : `${recipe.title} ${titleSuffix}`,
title: title.length === 0 ? APP_NAME : title.includes(titleSuffix) ? title : `${title} ${titleSuffix}`,
description,
alternates: {
canonical: recipe.canonical,
@@ -80,7 +81,7 @@ export const preparePageMetadata = (recipe: PageMetadataRecipe): Metadata => {
url: recipe.canonical,
type: "website",
siteName: recipe.siteName,
title: recipe.title,
title,
images: [recipe.image],
},
metadataBase: recipe.metadataBase,