A sample Next.js project configured for deployment to GitHub Pages, bootstrapped with create-next-app
.
/ (root)
├── docker-compose.yml
├── Dockerfile
├── eslint.config.mjs
├── next.config.ts
├── package.json
├── tsconfig.json
├── public/
│ ├── scigateway-white-text-blue-mark-logo.svg
│ └── UKRI_STFC_SCIENTIFIC_COMPUTING_RGB.png
└── src/
└── app/
├── layout.tsx
├── page.tsx
└── theme.tsx
docker compose up
yarn install
yarn dev
Open http://localhost:3000/operationsgateway-project in your browser to see the result.
You can start editing the page by modifying src/app/page.tsx
. The page auto-updates as you edit the file.
To ensure images appear correctly on GitHub Pages, update the src
prop of your Image
components in src/app/page.tsx
to include the base path /operationsgateway-project/
(the slug of this repository):
<Image
src="/operationsgateway-project/vercel.svg"
alt="Vercel Logo"
className={styles.vercelLogo}
width={100}
height={24}
priority
/>
Learn more in the Next.js basePath and images documentation.
To deploy to GitHub Pages, follow the Next.js GitHub Pages guide and ensure your next.config.ts
is configured with the correct basePath
and assetPrefix
.
- Next.js Documentation - learn about Next.js features and API.
- Learn Next.js - an interactive Next.js tutorial.
- Next.js GitHub repository