···11+# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
22+33+# dependencies
44+/node_modules
55+/.pnp
66+.pnp.*
77+.yarn/*
88+!.yarn/patches
99+!.yarn/plugins
1010+!.yarn/releases
1111+!.yarn/versions
1212+1313+# testing
1414+/coverage
1515+1616+# next.js
1717+/.next/
1818+1919+# The `out` directory should not be ignored by version control
2020+# /out/
2121+2222+# production
2323+/build
2424+2525+# misc
2626+.DS_Store
2727+*.pem
2828+2929+# debug
3030+npm-debug.log*
3131+yarn-debug.log*
3232+yarn-error.log*
3333+3434+# local env files
3535+.env*.local
3636+3737+# vercel
3838+.vercel
3939+4040+# typescript
4141+*.tsbuildinfo
4242+next-env.d.ts
+31
README.md
···11+# Deploy Next.js to GitHub Pages
22+33+This is a Next.js template which can be deployed to GitHub Pages as a static site.
44+55+## Deploying to GitHub Pages
66+77+1. Create a new public GitHub repository
88+1. Edit `next.config.js` to match your GitHub repository name:
99+ - Given the pattern `https://github.com/<user>/<repo>`, update your `basePath` config to the name of your repo (e.g. `/repo`)
1010+1. Push the starter code to the `main` branch
1111+1. Run the `deploy` script (e.g. `npm run deploy`) to create the `gh-pages` branch
1212+1. On GitHub, go to **Settings** > **Pages** > **Branch**, and choose `gh-pages` as the branch with the `/root` folder. Hit **Save**
1313+1. Make a change
1414+1. Run the `deploy` script again to push the changes to GitHub Pages
1515+1616+Congratulations! You should have a URL like:
1717+1818+```bash
1919+https://<github-user-name>.github.io/<github-project-name>/
2020+```
2121+2222+For more information, see our [deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying/static-exports).
2323+2424+## Learn More
2525+2626+To learn more about Next.js, take a look at the following resources:
2727+2828+- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
2929+- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
3030+3131+You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome!
+18
app/layout.tsx
···11+import type { Metadata } from 'next';
22+33+export const metadata: Metadata = {
44+ title: 'Next.js on GitHub Pages',
55+ description: 'Deploy your static Next.js site to GitHub Pages.',
66+};
77+88+export default function RootLayout({
99+ children,
1010+}: Readonly<{
1111+ children: React.ReactNode;
1212+}>) {
1313+ return (
1414+ <html lang="en">
1515+ <body>{children}</body>
1616+ </html>
1717+ );
1818+}
+7
app/page.tsx
···11+export default function Home() {
22+ return (
33+ <main>
44+ <div>Next.js on GitHub Pages</div>
55+ </main>
66+ );
77+}