Skip to content

Commit f818b4e

Browse files
committed
Initial commit
1 parent 2c80706 commit f818b4e

File tree

5 files changed

+70
-2
lines changed

5 files changed

+70
-2
lines changed

README.md

+44-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,44 @@
1-
# next-lingui
2-
Created with CodeSandbox
1+
[![Deploy to now](https://deploy.now.sh/static/button.svg)](https://deploy.now.sh/?repo=https://github.com/zeit/next.js/tree/master/examples/hello-world)
2+
3+
# Hello World example
4+
5+
## How to use
6+
7+
### Using `create-next-app`
8+
9+
Execute [`create-next-app`](https://github.com/segmentio/create-next-app) with [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) or [npx](https://github.com/zkat/npx#readme) to bootstrap the example:
10+
11+
```bash
12+
npx create-next-app --example hello-world hello-world-app
13+
# or
14+
yarn create next-app --example hello-world hello-world-app
15+
```
16+
17+
### Download manually
18+
19+
Download the example:
20+
21+
```bash
22+
curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/hello-world
23+
cd hello-world
24+
```
25+
26+
Install it and run:
27+
28+
```bash
29+
npm install
30+
npm run dev
31+
# or
32+
yarn
33+
yarn dev
34+
```
35+
36+
Deploy it to the cloud with [now](https://zeit.co/now) ([download](https://zeit.co/download))
37+
38+
```bash
39+
now
40+
```
41+
42+
## The idea behind the example
43+
44+
This example shows the most basic idea behind Next. We have 2 pages: `pages/index.js` and `pages/about.js`. The former responds to `/` requests and the latter to `/about`. Using `next/link` you can add hyperlinks between them with universal routing capabilities. The `day` directory shows that you can have subdirectories.

package.json

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"name": "hello-world",
3+
"version": "1.0.0",
4+
"scripts": {
5+
"dev": "next",
6+
"build": "next build",
7+
"start": "next start"
8+
},
9+
"dependencies": {
10+
"next": "latest",
11+
"react": "16.8.2",
12+
"react-dom": "^16.7.0"
13+
},
14+
"license": "ISC"
15+
}

pages/about.js

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export default () => <div>About us</div>

pages/day/index.js

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export default () => <div>Hello Day</div>

pages/index.js

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import Link from 'next/link'
2+
export default () => (
3+
<div>
4+
Hello World.{' '}
5+
<Link href='/about'>
6+
<a>About</a>
7+
</Link>
8+
</div>
9+
)

0 commit comments

Comments
 (0)