Unverified Commit b9620e6b authored by Jiwon Choi's avatar Jiwon Choi Committed by GitHub

docs: improve file tree (#77889)

The file tree can be improved and share the same convention:

- Use the `txt` file extension.
- One tab indented.
- Use file tree with root `.` and trailing slash for folders.

x-ref: https://tree.nathanfriend.io
parent 4f5531b1
......@@ -156,13 +156,13 @@ Navigating to the `/mdx-page` route should display your rendered MDX page.
Create a new page within the `/app` directory and an MDX file wherever you'd like:
```txt
my-project
├── app
│ └── mdx-page
.
├── app/
│ └── mdx-page/
│ └── page.(tsx/js)
├── markdown
├── markdown/
│ └── welcome.(mdx/md)
|── mdx-components.(tsx/js)
├── mdx-components.(tsx/js)
└── package.json
```
......@@ -173,12 +173,12 @@ Create a new page within the `/app` directory and an MDX file wherever you'd lik
Create a new page within the `/pages` directory and an MDX file wherever you'd like:
```txt
my-project
├── pages
│ └── mdx-page.(tsx/js)
├── markdown
.
├── markdown/
│ └── welcome.(mdx/md)
|── mdx-components.(tsx/js)
├── pages/
│ └── mdx-page.(tsx/js)
├── mdx-components.(tsx/js)
└── package.json
```
......
......@@ -21,14 +21,15 @@ In the Pages Router, only special files are allowed to generate pages. You canno
Correct structure:
```
pages/
├── index.js
└── about.js
components/
└── Header.js
styles/
└── globals.css
```txt
.
├── components/
│ └── Header.js
├── pages/
│ ├── about.js
│ └── index.js
└── styles/
└── globals.css
```
#### App Router (Next.js 13+)
......@@ -37,15 +38,16 @@ The App Router allows [colocation](/docs/app/getting-started/project-structure#c
Example folder structure:
```
app/
├── layout.tsx
├── page.tsx
├── about/
│ └── page.tsx
└── blog/
├── page.tsx
└── PostCard.tsx
```txt
.
└── app/
├── about/
│ └── page.tsx
├── blog/
│ ├── page.tsx
│ └── PostCard.tsx
├── layout.tsx
└── page.tsx
```
### 2. Handle undefined props and missing data
......
......@@ -14,25 +14,23 @@ You can move your `static` directory inside of the `public` directory and all UR
**Before**
```
static/
my-image.jpg
pages/
index.js
components/
my-image.js
```txt
.
├── pages/
│ └── index.js
└── static/
└── my-image.jpg
```
**After**
```
public/
static/
my-image.jpg
pages/
index.js
components/
my-image.js
```txt
.
├── pages/
│ └── index.js
└── public/
└── static/
└── my-image.jpg
```
## Useful Links
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment