提交 7674bab7 编写于 作者: I Ismael Martínez 提交者: Joe Haddad

Change /static directory in favor of /public directory for create-next-app (#8984)

上级 1b518f06
......@@ -14,7 +14,6 @@ Find the most recent version of this guide at [here](https://github.com/zeit/nex
- [Adding Components](#adding-components)
- [Fetching Data](#fetching-data)
- [Syntax Highlighting](#syntax-highlighting)
- [Using the `static` Folder](#using-the-static-folder)
- [Deploy to Now](#deploy-to-now)
- [Something Missing?](#something-missing)
......@@ -37,7 +36,7 @@ After creating an app, it should look something like:
├── package.json
├── pages
│ └── index.js
├── static
├── public
│ └── favicon.ico
└── yarn.lock
```
......@@ -45,7 +44,7 @@ After creating an app, it should look something like:
Routing in Next.js is based on the file system, so `./pages/index.js` maps to the `/` route and
`./pages/about.js` would map to `/about`.
The `./static` directory maps to `/static` in the `next` server, so you can put all your
The `./public` directory maps to `/` in the `next` server, so you can put all your
other static resources like images or compiled CSS in there.
Out of the box, we get:
......@@ -53,7 +52,7 @@ Out of the box, we get:
- Automatic compilation and bundling (with Babel and webpack)
- Hot code reloading
- Server rendering and indexing of `./pages/`
- Static file serving. `./static/` is mapped to `/static/`
- Static file serving. `./public/` is mapped to `/`
Read more about [Next's Routing](https://github.com/zeit/next.js#routing)
......
......@@ -6,7 +6,7 @@ const Home = () => (
<div>
<Head>
<title>Home</title>
<link rel='icon' href='/static/favicon.ico' />
<link rel='icon' href='/favicon.ico' />
</Head>
<Nav />
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册