https://github.com/xta/next-hello-world-gh
next js (react)
https://github.com/xta/next-hello-world-gh
Last synced: 3 months ago
JSON representation
next js (react)
- Host: GitHub
- URL: https://github.com/xta/next-hello-world-gh
- Owner: xta
- Created: 2022-05-03T08:52:23.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2022-05-03T08:59:21.000Z (about 4 years ago)
- Last Synced: 2025-03-16T13:09:34.686Z (about 1 year ago)
- Language: HTML
- Homepage: https://xta.github.io/next-hello-world-gh/
- Size: 114 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# gh-pages Hello World example
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.
## How to use
Execute [`create-next-app`](https://github.com/vercel/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:
```bash
npx create-next-app --example gh-pages gh-pages-app
# or
yarn create next-app --example gh-pages gh-pages-app
# or
pnpm create next-app -- --example gh-pages gh-pages-app
```
### Deploy it to github
Edit `env-config.js` and replace `'Next-gh-page-example'` by your project name.
Edit `next.config.js` and replace `'Next-gh-page-example'` by your project name.
1. Create repository.
2. Link it to your github account.
3. Publish your default branch, e.g. `main`.
```bash
npm run deploy
```
Test it:
Replace `` and ``
```bash
https://.github.io//
```
Example:
```bash
https://github.com/thierryc/Next-gh-page-example/
https://thierryc.github.io/Next-gh-page-example/
```