Skip to content

Commit

Permalink
docs: made example in Route File Nmaing stricter (#9378)
Browse files Browse the repository at this point in the history
  • Loading branch information
soartec-lab committed May 6, 2024
1 parent 6b30d10 commit dbb076e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions contributors.yml
Expand Up @@ -676,3 +676,4 @@
- zainfathoni
- zayenz
- zhe
- soartec-lab
7 changes: 7 additions & 0 deletions docs/file-conventions/routes.md
Expand Up @@ -84,6 +84,8 @@ Adding a `.` to a route filename will create a `/` in the URL.

| URL | Matched Route |
| -------------------------- | ---------------------------------------- |
| `/` | `app/routes/_index.tsx` |
| `/about` | `app/routes/about.tsx` |
| `/concerts/trending` | `app/routes/concerts.trending.tsx` |
| `/concerts/salt-lake-city` | `app/routes/concerts.salt-lake-city.tsx` |
| `/concerts/san-diego` | `app/routes/concerts.san-diego.tsx` |
Expand All @@ -106,6 +108,8 @@ Usually your URLs aren't static but data-driven. Dynamic segments allow you to m

| URL | Matched Route |
| -------------------------- | ---------------------------------- |
| `/` | `app/routes/_index.tsx` |
| `/about` | `app/routes/about.tsx` |
| `/concerts/trending` | `app/routes/concerts.trending.tsx` |
| `/concerts/salt-lake-city` | `app/routes/concerts.$city.tsx` |
| `/concerts/san-diego` | `app/routes/concerts.$city.tsx` |
Expand Down Expand Up @@ -196,6 +200,7 @@ Sometimes you want the URL to be nested, but you don't want the automatic layout
| URL | Matched Route | Layout |
| -------------------------- | ---------------------------------- | ------------------------- |
| `/` | `app/routes/_index.tsx` | `app/root.tsx` |
| `/about` | `app/routes/about.tsx` | `app/root.tsx` |
| `/concerts/mine` | `app/routes/concerts_.mine.tsx` | `app/root.tsx` |
| `/concerts/trending` | `app/routes/concerts.trending.tsx` | `app/routes/concerts.tsx` |
| `/concerts/salt-lake-city` | `app/routes/concerts.$city.tsx` | `app/routes/concerts.tsx` |
Expand Down Expand Up @@ -227,6 +232,7 @@ Sometimes you want to share a layout with a group of routes without adding any p
| `/` | `app/routes/_index.tsx` | `app/root.tsx` |
| `/login` | `app/routes/_auth.login.tsx` | `app/routes/_auth.tsx` |
| `/register` | `app/routes/_auth.register.tsx` | `app/routes/_auth.tsx` |
| `/concerts` | `app/routes/concerts.tsx` | `app/routes/concerts.tsx` |
| `/concerts/salt-lake-city` | `app/routes/concerts.$city.tsx` | `app/routes/concerts.tsx` |

Think of the `_leading` underscore as a blanket you're pulling over the filename, hiding the filename from the URL.
Expand Down Expand Up @@ -273,6 +279,7 @@ While [dynamic segments][dynamic_segments] match a single path segment (the stuf
| URL | Matched Route |
| -------------------------------------------- | ------------------------ |
| `/` | `app/routes/_index.tsx` |
| `/about` | `app/routes/about.tsx` |
| `/beef/and/cheese` | `app/routes/$.tsx` |
| `/files` | `app/routes/files.$.tsx` |
| `/files/talks/remix-conf_old.pdf` | `app/routes/files.$.tsx` |
Expand Down

0 comments on commit dbb076e

Please sign in to comment.