Skip to content

Commit 76f99e5

Browse files
committed
Update contributing.md with a README template
1 parent 91180cb commit 76f99e5

File tree

1 file changed

+61
-0
lines changed

1 file changed

+61
-0
lines changed

contributing.md

+61
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ Our Commitment to Open Source can be found [here](https://zeit.co/blog/oss)
1212

1313
> You may need to run `yarn types` again if your types get outdated.
1414
15+
To contribute to [our examples](examples), take a look at the [“Adding examples” section](#adding-examples).
16+
1517
## To run tests
1618

1719
Make sure you have `chromedriver` installed for your Chrome version. You can install it with
@@ -112,3 +114,62 @@ EXAMPLE=./test/integration/basic
112114
```sh
113115
yarn install --force
114116
```
117+
118+
## Adding examples
119+
120+
When you add an example to the [examples](examples) directory, don’t forget to add a `README.md` file with the following format:
121+
122+
- Replace `DIRECTORY_NAME` with the directory name you’re adding.
123+
- Fill in `Example Name` and `Description`.
124+
- To add additional installation instructions, please add it where appropriate.
125+
- To add additional notes, add `## Notes` section at the end.
126+
- Remove the `Deploy your own` section if your example can’t be immediately deployed to ZEIT Now.
127+
128+
````markdown
129+
# Example Name
130+
131+
Description
132+
133+
## Deploy your own
134+
135+
Deploy the example using [ZEIT Now](https://zeit.co/now):
136+
137+
[![Deploy with ZEIT Now](https://zeit.co/button)](https://zeit.co/new/project?template=https://github.com/zeit/next.js/tree/canary/examples/DIRECTORY_NAME)
138+
139+
## How to use
140+
141+
### Using `create-next-app`
142+
143+
Execute [`create-next-app`](https://github.com/zeit/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example:
144+
145+
```bash
146+
npx create-next-app --example DIRECTORY_NAME DIRECTORY_NAME-app
147+
# or
148+
yarn create next-app --example DIRECTORY_NAME DIRECTORY_NAME-app
149+
```
150+
151+
### Download manually
152+
153+
Download the example:
154+
155+
```bash
156+
curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/DIRECTORY_NAME
157+
cd DIRECTORY_NAME
158+
```
159+
160+
Install it and run:
161+
162+
```bash
163+
npm install
164+
npm run dev
165+
# or
166+
yarn
167+
yarn dev
168+
```
169+
170+
Deploy it to the cloud with [now](https://zeit.co/now) ([download](https://zeit.co/download)):
171+
172+
```bash
173+
now
174+
```
175+
````

0 commit comments

Comments
 (0)