Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
7674bab7
Commit
7674bab7
authored
Oct 07, 2019
by
Ismael Martínez
Committed by
Joe Haddad
Oct 07, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change /static directory in favor of /public directory for create-next-app (#8984)
parent
1b518f06
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
5 deletions
+4
-5
README.md
packages/create-next-app/templates/default/README.md
+3
-4
index.js
packages/create-next-app/templates/default/pages/index.js
+1
-1
favicon.ico
...ages/create-next-app/templates/default/public/favicon.ico
+0
-0
No files found.
packages/create-next-app/templates/default/README.md
View file @
7674bab7
...
...
@@ -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
├──
stat
ic
├──
publ
ic
│ └── 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
)
...
...
packages/create-next-app/templates/default/pages/index.js
View file @
7674bab7
...
...
@@ -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
/>
...
...
packages/create-next-app/templates/default/
stat
ic/favicon.ico
→
packages/create-next-app/templates/default/
publ
ic/favicon.ico
View file @
7674bab7
File moved
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment