[TIL] Next.js Adding metadata

Dec 15, 2023 | Jun 21, 2024
|
Ryoon.With.Wisdomtrees
Ryoon.With.Wisdomtrees

Adding metadata

Next.js has a Metadata API that can be used to define your application metadata. There are two ways you can add metadata to your application:
  • File-based: Next.js has a range of special files that are specifically used for metadata purposes:
    • favicon.icoapple-icon.jpg, and icon.jpg: Utilized for favicons and icons
    • opengraph-image.jpg and twitter-image.jpg: Employed for social media images
    • robots.txt: Provides instructions for search engine crawling
    • sitemap.xml: Offers information about the website's structure
    •  
       

Page specific하게 metadata 적용하기

Instead, you can use the title.template field in the metadata object to define a template for your page titles. This template can include the page title, and any other information you want to include.
The %s in the template will be replaced with the specific page title.
Now, in your /dashboard/invoices page, you can add the page title:
[TIL] Github 계정 여러개 연결하여 사용하기 w/ ssh, gitconfig파일[TIL] MetaData란?
  뒤로  
기술 로그
사이드 프로젝트
능동적 나눔과 기쁨
생각 조각 모음
독서 노트
독후감
영감 기록