Commit 7674bab7 authored by Ismael Martínez's avatar Ismael Martínez Committed by Joe Haddad

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

parent 1b518f06
...@@ -14,7 +14,6 @@ Find the most recent version of this guide at [here](https://github.com/zeit/nex ...@@ -14,7 +14,6 @@ Find the most recent version of this guide at [here](https://github.com/zeit/nex
- [Adding Components](#adding-components) - [Adding Components](#adding-components)
- [Fetching Data](#fetching-data) - [Fetching Data](#fetching-data)
- [Syntax Highlighting](#syntax-highlighting) - [Syntax Highlighting](#syntax-highlighting)
- [Using the `static` Folder](#using-the-static-folder)
- [Deploy to Now](#deploy-to-now) - [Deploy to Now](#deploy-to-now)
- [Something Missing?](#something-missing) - [Something Missing?](#something-missing)
...@@ -37,7 +36,7 @@ After creating an app, it should look something like: ...@@ -37,7 +36,7 @@ After creating an app, it should look something like:
├── package.json ├── package.json
├── pages ├── pages
│ └── index.js │ └── index.js
├── static ├── public
│ └── favicon.ico │ └── favicon.ico
└── yarn.lock └── yarn.lock
``` ```
...@@ -45,7 +44,7 @@ After creating an app, it should look something like: ...@@ -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 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`. `./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. other static resources like images or compiled CSS in there.
Out of the box, we get: Out of the box, we get:
...@@ -53,7 +52,7 @@ Out of the box, we get: ...@@ -53,7 +52,7 @@ Out of the box, we get:
- Automatic compilation and bundling (with Babel and webpack) - Automatic compilation and bundling (with Babel and webpack)
- Hot code reloading - Hot code reloading
- Server rendering and indexing of `./pages/` - 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) Read more about [Next's Routing](https://github.com/zeit/next.js#routing)
......
...@@ -6,7 +6,7 @@ const Home = () => ( ...@@ -6,7 +6,7 @@ const Home = () => (
<div> <div>
<Head> <Head>
<title>Home</title> <title>Home</title>
<link rel='icon' href='/static/favicon.ico' /> <link rel='icon' href='/favicon.ico' />
</Head> </Head>
<Nav /> <Nav />
......
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