From 8fb9ddbb928894952bb52b4b0bdf054938926cef Mon Sep 17 00:00:00 2001 From: Arman Date: Fri, 18 Oct 2024 13:26:54 -0400 Subject: [PATCH] Change metadata to use template title --- src/app/(category-sidebar)/products/[category]/page.tsx | 4 ++-- src/app/layout.tsx | 5 ++++- src/app/order-history/page.tsx | 2 +- src/app/order/page.tsx | 2 +- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/app/(category-sidebar)/products/[category]/page.tsx b/src/app/(category-sidebar)/products/[category]/page.tsx index 6f7b307..f190f88 100644 --- a/src/app/(category-sidebar)/products/[category]/page.tsx +++ b/src/app/(category-sidebar)/products/[category]/page.tsx @@ -37,9 +37,9 @@ export async function generateMetadata({ .toLowerCase(); return { - title: `${category.name} | NextMaster`, + title: `${category.name}`, openGraph: { - title: `${category.name} | NextMaster`, + title: `${category.name}`, description: `Choose from our selection of ${category.name.toLowerCase()}, including ${examples + (category.subcollections.length > 1 ? "," : "")} and more. In stock and ready to ship.`, }, }; diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 779a59a..13fd12c 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -22,7 +22,10 @@ const futura = localFont({ }); export const metadata: Metadata = { - title: "NextMaster", + title: { + template: "%s | NextMaster", + default: "NextMaster", + }, description: "A performant site built with Next.js", }; diff --git a/src/app/order-history/page.tsx b/src/app/order-history/page.tsx index d637b81..b910646 100644 --- a/src/app/order-history/page.tsx +++ b/src/app/order-history/page.tsx @@ -2,7 +2,7 @@ import { LoginForm } from "@/components/login-form"; import { Metadata } from "next"; export const metadata: Metadata = { - title: "Order History | NextMaster", + title: "Order History", }; export default function Page() { diff --git a/src/app/order/page.tsx b/src/app/order/page.tsx index 63aac71..37606c2 100644 --- a/src/app/order/page.tsx +++ b/src/app/order/page.tsx @@ -11,7 +11,7 @@ import Link from "next/link"; import { Metadata } from "next"; export const metadata: Metadata = { - title: "Order | NextMaster", + title: "Order", }; export default async function Page() {