Skip to content

Commit 86033ff

Browse files
Migrate to GitHub Pages:
- Added MIT License - Configured next.config.js for subpath hosting (/webtoolkit_pro) - Created GitHub Actions deployment workflow - Updated Metadata API for favicon path handling - Updated Sitemap and Robots.txt with new GitHub URL
1 parent c9a38f6 commit 86033ff

6 files changed

Lines changed: 93 additions & 3 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
12+
13+
concurrency:
14+
group: "pages"
15+
cancel-in-progress: false
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v4
23+
24+
- name: Setup Node
25+
uses: actions/setup-node@v4
26+
with:
27+
node-version: "20"
28+
cache: 'npm'
29+
30+
- name: Setup Pages
31+
uses: actions/configure-pages@v4
32+
with:
33+
static_site_generator: next
34+
35+
- name: Install dependencies
36+
run: npm install
37+
38+
- name: Build with Next.js
39+
run: npx next build
40+
41+
- name: Upload artifact
42+
uses: actions/upload-pages-artifact@v3
43+
with:
44+
path: ./out
45+
46+
deploy:
47+
environment:
48+
name: github-pages
49+
url: ${{ steps.deployment.outputs.page_url }}
50+
runs-on: ubuntu-latest
51+
needs: build
52+
steps:
53+
- name: Deploy to GitHub Pages
54+
id: deployment
55+
uses: actions/deploy-pages@v4

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2026 WebToolkit Pro
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

app/layout.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ export const metadata = {
2222
siteName: 'WebToolkit Pro',
2323
type: 'website',
2424
},
25+
icons: {
26+
icon: '/favicon.svg',
27+
},
2528
}
2629

2730
interface RootLayoutProps {
@@ -40,7 +43,6 @@ export default function RootLayout({ children }: RootLayoutProps) {
4043
crossOrigin="anonymous"
4144
strategy="afterInteractive"
4245
/>
43-
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
4446
</head>
4547
<body className="bg-white text-gray-900 antialiased">
4648
<div className="min-h-screen flex flex-col">

app/robots.txt/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Disallow: /_next/
88
User-agent: Mediapartners-Google
99
Allow: /
1010
11-
Sitemap: https://webtoolkit-pro.netlify.app/sitemap.xml`
11+
Sitemap: https://abusufyan-netizen.github.io/webtoolkit_pro/sitemap.xml`
1212

1313
return new NextResponse(robots, {
1414
status: 200,

app/sitemap.xml/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { NextResponse } from 'next/server'
22

33
export async function GET() {
4-
const baseUrl = 'https://webtoolkit-pro.netlify.app'
4+
const baseUrl = 'https://abusufyan-netizen.github.io/webtoolkit_pro'
55
const now = new Date().toISOString()
66

77
const pages = [

next.config.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,19 @@
1+
const isGithubActions = process.env.GITHUB_ACTIONS || false
2+
let assetPrefix = ''
3+
let basePath = ''
4+
5+
if (isGithubActions) {
6+
const repo = process.env.GITHUB_REPOSITORY.replace(/.*?\//, '')
7+
assetPrefix = `/${repo}/`
8+
basePath = `/${repo}`
9+
}
10+
111
/** @type {import('next').NextConfig} */
212
const nextConfig = {
313
output: 'export',
414
trailingSlash: true,
15+
basePath: basePath,
16+
assetPrefix: assetPrefix,
517
images: {
618
unoptimized: true
719
}

0 commit comments

Comments
 (0)