From a8c2626bd1f2469df2be3dd289b2991f6d935e78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateus=20Felipe=20Gon=C3=A7alves?= Date: Tue, 28 Nov 2023 22:13:04 -0300 Subject: [PATCH] fix(seo): define `/blog` metadata on `page.tsx` instead of `layout.tsx` Prevent pass metadata to subroutes of `/blog` --- src/app/blog/layout.tsx | 17 ----------------- src/app/blog/page.tsx | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 17 deletions(-) diff --git a/src/app/blog/layout.tsx b/src/app/blog/layout.tsx index 654ab28d..faa29fde 100644 --- a/src/app/blog/layout.tsx +++ b/src/app/blog/layout.tsx @@ -1,20 +1,3 @@ -import type { Metadata } from 'next' - -export const metadata: Metadata = { - title: 'Blog', - description: - 'My personal posts and thoughts about all kind of stuff that I like. Main philosophic and technical text.', - keywords: [ - 'blog', - 'thoughts', - 'texts', - 'technical', - 'tutorials', - 'posts', - 'phisolophy' - ] -} - export default function BlogLayout({ children }: { diff --git a/src/app/blog/page.tsx b/src/app/blog/page.tsx index a9e98a41..78f7df64 100644 --- a/src/app/blog/page.tsx +++ b/src/app/blog/page.tsx @@ -1,4 +1,5 @@ import React from 'react' +import { type Metadata } from 'next' import Link, { LinkProps } from 'next/link' import { allPosts } from 'contentlayer/generated' @@ -13,6 +14,21 @@ import { getSortedPosts } from '@/shared/lib/get-sorted-posts' import { PostList } from '@/shared/components/post-list' import { Title } from '@/shared/components/title' +export const metadata: Metadata = { + title: 'Blog', + description: + 'My personal posts and thoughts about all kind of stuff that I like. Main philosophic and technical text.', + keywords: [ + 'blog', + 'thoughts', + 'texts', + 'technical', + 'tutorials', + 'posts', + 'phisolophy' + ] +} + type TopLinkProps = { Icon: PhosphorIcon title: string