Skip to content

Commit

Permalink
refactor: use metadataBase and relative paths
Browse files Browse the repository at this point in the history
  • Loading branch information
leapalazzolo committed Feb 6, 2024
1 parent 310a5b2 commit fd8cfc2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 1 addition & 2 deletions app/explore/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ interface IProps {
}

export async function generateMetadata({ params }: IProps): Promise<Metadata> {
const url = SITE_CONFIG.url;
const { slug } = params;
const title = slug
.split("-")
Expand All @@ -28,7 +27,7 @@ export async function generateMetadata({ params }: IProps): Promise<Metadata> {
title,
description,
alternates: {
canonical: `${url}/${slug}`,
canonical: `/${slug}`,
},
};
}
Expand Down
3 changes: 2 additions & 1 deletion app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ export const fontMono = Fira_Code({
});

export const metadata: Metadata = {
metadataBase: new URL(SITE_CONFIG.url!),
alternates: {
canonical: SITE_CONFIG.url,
canonical: "/",
},
title: {
default: SITE_CONFIG.name,
Expand Down

0 comments on commit fd8cfc2

Please sign in to comment.