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

Update note about public and pages overlap #10287

Merged
merged 5 commits into from Jan 30, 2020
Merged
Changes from 3 commits
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: 6 additions & 2 deletions docs/basic-features/static-file-serving.md
Expand Up @@ -16,6 +16,10 @@ function MyImage() {
export default MyImage
```

> Don't name the `public` directory anything else. The name can't be changed and is the only directory that **Next.js** uses to serve static assets.
This folder is also useful for `robots.txt`, Google Site Verification, and any other static files (including `.html`)!

> If you ever add a static asset that conflicts with the name of a page in the `pages` directory, the public file will be ignored in favor of the file in `pages`.
> **Note**: Don't name the `public` directory anything else. The name cannot be changed and is the only directory used to serve static assets.

> **Note**: Be sure to not have a static file with the same name as a file in the `pages/` directory, as this will result in an error.
>
> Read more: <http://err.sh/next.js/conflicting-public-file-page>