Skip to content

Commit

Permalink
fix: merge locale layout metadata with root layout metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanprobst committed May 6, 2024
1 parent d758c6e commit ec876dc
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/[locale]/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ export async function generateMetadata(
const { locale } = params;
const t = await getTranslations({ locale, namespace: "LocaleLayout" });

const rootMetadata = await _parent;

const metadata: Metadata = {
title: {
default: t("meta.title"),
Expand All @@ -66,6 +68,7 @@ export async function generateMetadata(
google: env.NEXT_PUBLIC_GOOGLE_SITE_VERIFICATION,
},
alternates: {
canonical: rootMetadata.alternates?.canonical,
types: {
"application/rss+xml": locales.map((locale) => {
return { title: `RSS Feed (${locale})`, url: `/${locale}/rss.xml` };
Expand Down

0 comments on commit ec876dc

Please sign in to comment.