Skip to content

Commit ec82666

Browse files
committed
Init
0 parents  commit ec82666

File tree

7 files changed

+152
-0
lines changed

7 files changed

+152
-0
lines changed

.gitignore

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.*
7+
.yarn/*
8+
!.yarn/patches
9+
!.yarn/plugins
10+
!.yarn/releases
11+
!.yarn/versions
12+
13+
# testing
14+
/coverage
15+
16+
# next.js
17+
/.next/
18+
19+
# The `out` directory should not be ignored by version control
20+
# /out/
21+
22+
# production
23+
/build
24+
25+
# misc
26+
.DS_Store
27+
*.pem
28+
29+
# debug
30+
npm-debug.log*
31+
yarn-debug.log*
32+
yarn-error.log*
33+
34+
# local env files
35+
.env*.local
36+
37+
# vercel
38+
.vercel
39+
40+
# typescript
41+
*.tsbuildinfo
42+
next-env.d.ts

README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Deploy Next.js to GitHub Pages
2+
3+
This is a Next.js template which can be deployed to GitHub Pages as a static site.
4+
5+
## Deploying to GitHub Pages
6+
7+
1. Create a new public GitHub repository
8+
1. Edit `next.config.js` to match your GitHub repository name:
9+
- Given the pattern `https://github.com/<user>/<repo>`, update your `basePath` config to the name of your repo (e.g. `/repo`)
10+
1. Push the starter code to the `main` branch
11+
1. Run the `deploy` script (e.g. `npm run deploy`) to create the `gh-pages` branch
12+
1. On GitHub, go to **Settings** > **Pages** > **Branch**, and choose `gh-pages` as the branch with the `/root` folder. Hit **Save**
13+
1. Make a change
14+
1. Run the `deploy` script again to push the changes to GitHub Pages
15+
16+
Congratulations! You should have a URL like:
17+
18+
```bash
19+
https://<github-user-name>.github.io/<github-project-name>/
20+
```
21+
22+
For more information, see our [deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying/static-exports).
23+
24+
## Learn More
25+
26+
To learn more about Next.js, take a look at the following resources:
27+
28+
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
29+
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
30+
31+
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome!

app/layout.tsx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import type { Metadata } from 'next';
2+
3+
export const metadata: Metadata = {
4+
title: 'Next.js on GitHub Pages',
5+
description: 'Deploy your static Next.js site to GitHub Pages.',
6+
};
7+
8+
export default function RootLayout({
9+
children,
10+
}: Readonly<{
11+
children: React.ReactNode;
12+
}>) {
13+
return (
14+
<html lang="en">
15+
<body>{children}</body>
16+
</html>
17+
);
18+
}

app/page.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
export default function Home() {
2+
return (
3+
<main>
4+
<div>Next.js on GitHub Pages</div>
5+
</main>
6+
);
7+
}

next.config.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import type { NextConfig } from 'next';
2+
3+
const nextConfig: NextConfig = {
4+
output: 'export',
5+
basePath: '/your-repo-name',
6+
};
7+
8+
export default nextConfig;

package.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"private": true,
3+
"scripts": {
4+
"dev": "next dev --turbo",
5+
"build": "next build",
6+
"deploy": "next build && touch out/.nojekyll && git add out/ && git commit -m \"Deploy\" && git subtree push --prefix out origin gh-pages"
7+
},
8+
"dependencies": {
9+
"react": "19.0.0-rc-cd22717c-20241013",
10+
"react-dom": "19.0.0-rc-cd22717c-20241013",
11+
"next": "15.0.0-canary.196"
12+
},
13+
"devDependencies": {
14+
"typescript": "^5",
15+
"@types/node": "^20",
16+
"@types/react": "^18",
17+
"@types/react-dom": "^18"
18+
}
19+
}

tsconfig.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"compilerOptions": {
3+
"target": "ES2017",
4+
"lib": ["dom", "dom.iterable", "esnext"],
5+
"allowJs": true,
6+
"skipLibCheck": true,
7+
"strict": true,
8+
"noEmit": true,
9+
"esModuleInterop": true,
10+
"module": "esnext",
11+
"moduleResolution": "bundler",
12+
"resolveJsonModule": true,
13+
"isolatedModules": true,
14+
"jsx": "preserve",
15+
"incremental": true,
16+
"plugins": [
17+
{
18+
"name": "next"
19+
}
20+
],
21+
"paths": {
22+
"@/*": ["./*"]
23+
}
24+
},
25+
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
26+
"exclude": ["node_modules"]
27+
}

0 commit comments

Comments
 (0)