Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify with commas #31224

Merged
merged 6 commits into from
Nov 15, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions docs/routing/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ description: Next.js has a built-in, opinionated, and file-system based Router.

Next.js has a file-system based router built on the [concept of pages](/docs/basic-features/pages.md).

When a file is added to the `pages` directory it's automatically available as a route.
When a file is added to the `pages` directory, it's automatically available as a route.

The files inside the `pages` directory can be used to define most common patterns.

Expand All @@ -19,14 +19,14 @@ The router will automatically route files named `index` to the root of the direc

#### Nested routes

The router supports nested files. If you create a nested folder structure files will be automatically routed in the same way still.
The router supports nested files. If you create a nested folder structure, files will be automatically routed in the same way still.
timneutkens marked this conversation as resolved.
Show resolved Hide resolved

- `pages/blog/first-post.js` → `/blog/first-post`
- `pages/dashboard/settings/username.js` → `/dashboard/settings/username`

#### Dynamic route segments

To match a dynamic segment you can use the bracket syntax. This allows you to match named parameters.
To match a dynamic segment, you can use the bracket syntax. This allows you to match named parameters.

- `pages/blog/[slug].js` → `/blog/:slug` (`/blog/hello-world`)
- `pages/[username]/settings.js` → `/:username/settings` (`/foo/settings`)
Expand Down Expand Up @@ -68,7 +68,7 @@ function Home() {
export default Home
```

In the example above we have multiple links, each one maps a path (`href`) to a known page:
In the example above, we have multiple links; each one maps a path (`href`) to a known page:
TurekBot marked this conversation as resolved.
Show resolved Hide resolved

- `/` → `pages/index.js`
- `/about` → `pages/about.js`
Expand Down