프로그래밍/NextJS

nextjs 넥스트 메타데이터 추가하기

타코코딩 2024. 1. 22. 19:22

메타데이터 추가

export const metadata: Metadata = { title:'CODING-STORY - HOME', description:'코딩커뮤니티 홈입니다' }

  • 동적 메타데이터 추가
export async function generateMetadata({ params }: Iprops){
  const issue = await prisma.issue.findUnique({
    where: { id: Number(params.id) },
  });

  return {
    title: issue?.title,
description : '상세 페이지' + issue?.id
    }
}

 

'프로그래밍 > NextJS' 카테고리의 다른 글

next 14 설치 및 초기화  (0) 2024.04.03
typeorm 메서드 총정리  (0) 2024.03.28
nextjs 넥스트 필터링 및 차트구현 rechats  (0) 2024.01.22
nextauth 넥스트어스 사용하기  (0) 2024.01.22
next Radix 설치 및 사용  (1) 2024.01.22