⊗jsnxPmLtMd 34 of 57 menu

Metadata in NextJS

Let's now look at how to add a title and meta description to the page. In NextJS, they are handled together and are therefore referred to by the common term metadata.

Metadata is specified using a special object containing the title and meta description:

{ title: '...', description: '...', };

In this case, NextJS will automatically insert the metadata into the corresponding tags. We don't need to worry about it. That's why the main site layout lacks the head tag, as it will be generated automatically:

export default function RootLayout({children}) { return ( <html lang="en"> <body> {children} </body> </html> ); }

There are various ways to specify metadata. We will study them in the following lessons.

English
AfrikaansAzərbaycanБългарскиবাংলাБеларускаяČeštinaDanskDeutschΕλληνικάEspañolEestiSuomiFrançaisहिन्दीMagyarՀայերենIndonesiaItaliano日本語ქართულიҚазақ한국어КыргызчаLietuviųLatviešuМакедонскиMelayuမြန်မာNederlandsNorskPolskiPortuguêsRomânăРусскийසිංහලSlovenčinaSlovenščinaShqipСрпскиSrpskiSvenskaKiswahiliТоҷикӣไทยTürkmenTürkçeЎзбекOʻzbekTiếng Việt
We use cookies for website operation, analytics, and personalization. Data processing is carried out in accordance with the Privacy Policy.
accept all customize decline