Next.js Tutorials

Generate Dynamic Metadata in Next.js: Metadata Object & generateMetadata Options

Generally, we use something like this to create metadata in Next.js: And it works very well, as we can see below: But if you observe the source code, you can see one other that is by default defined by Next.js by root layout: The same goes for descriptions and other tags: Having duplicate metadata tags […]

Generate Dynamic Metadata in Next.js: Metadata Object & generateMetadata Options Read More »

Link Component in Next.js: Navigating Between Pages

In our previous tutorial, we learned how to create different pages in Next.js using file-based routing but to switch between pages we changed the URL manually. Like for the Home page we entered http://localhost:3000/, for the About Us page we entered http://localhost:3000/about but how to navigate between pages directly? Well here comes the Link component

Link Component in Next.js: Navigating Between Pages Read More »

File-Based Routing in Next.js 13+: The App Router Update

Before Next.js 13, routing was based on the “pages” directory, where each file inside it was considered a route. For example, a file named “pages/about.js” will create a route “/about” containing the content returned by about.js. This approach was created to remove the need to create routes manually, but as applications grow, the “pages” directory

File-Based Routing in Next.js 13+: The App Router Update Read More »