Skip to content

This repository describes the basic way how to generate dynamic routes in nextjs. The [[...slug]].js file must create all the logic to build the index which will contain the blog paginator.

anthonycifuentes/nextjs-dynamic-routes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NextJS Dynamic Routes

This repository describes the basic way how to generate dynamic routes in nextjs. The [[...slug]].js file must create all the logic to build the index which will contain the blog paginator.

Getting Started

First, run the development server:

npm run dev
# or
yarn dev

To generate static files:

npm run build

Folder structure

image

To create dynamic routes in [[...slug]].js, we have to return in getStaticPaths function this Object:

image

Output:

image

Learn More

To learn more about Next.js, take a look at the following resources:

About

This repository describes the basic way how to generate dynamic routes in nextjs. The [[...slug]].js file must create all the logic to build the index which will contain the blog paginator.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published