Skip to content

Commit 1cf234b

Browse files
authored
Enhance configuration and metadata for improved SEO, performance, and user experience
1 parent 9e4c6d2 commit 1cf234b

File tree

11 files changed

+988
-118
lines changed

11 files changed

+988
-118
lines changed

next.config.mjs

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,25 @@
11
/** @type {import('next').NextConfig} */
22
const nextConfig = {
33
output: 'export',
4-
4+
trailingSlash: true,
5+
images: {
6+
unoptimized: true,
7+
remotePatterns: [
8+
{
9+
protocol: 'https',
10+
hostname: 'github.com',
11+
port: '',
12+
pathname: '/**',
13+
},
14+
],
15+
},
16+
experimental: {
17+
optimizeCss: true,
18+
},
19+
compress: true,
20+
poweredByHeader: false,
21+
generateEtags: true,
22+
assetPrefix: process.env.NODE_ENV === 'production' ? 'https://sopkit.github.io' : '',
523
};
624

725
export default nextConfig;

package.json

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,37 @@
11
{
22
"name": "sopkit.github.io",
3-
"version": "0.1.0",
3+
"version": "1.0.0",
4+
"description": "Professional web development tools and utilities suite - free, open-source, and modern",
5+
"author": "SopKit Team <sh20raj@gmail.com>",
6+
"license": "MIT",
7+
"homepage": "https://sopkit.github.io",
8+
"repository": {
9+
"type": "git",
10+
"url": "https://github.com/sopkit/sopkit.github.io.git"
11+
},
12+
"keywords": [
13+
"web development tools",
14+
"developer utilities",
15+
"json formatter",
16+
"html to jsx",
17+
"markdown converter",
18+
"encoding tools",
19+
"online tools",
20+
"programming utilities",
21+
"open source",
22+
"next.js"
23+
],
424
"private": true,
525
"scripts": {
626
"dev": "next dev",
727
"build": "next build",
828
"start": "next start",
929
"lint": "next lint",
10-
"export": "next export"
30+
"lint:fix": "next lint --fix",
31+
"export": "next export",
32+
"analyze": "cross-env ANALYZE=true next build",
33+
"sitemap": "next-sitemap",
34+
"optimize": "npm run lint:fix && npm run build && npm run analyze"
1135
},
1236
"dependencies": {
1337
"@radix-ui/react-dialog": "^1.1.1",
@@ -24,9 +48,16 @@
2448
"tailwindcss-animate": "^1.0.7"
2549
},
2650
"devDependencies": {
51+
"@next/bundle-analyzer": "^15.1.7",
52+
"cross-env": "^7.0.3",
2753
"eslint": "^8",
2854
"eslint-config-next": "14.2.4",
55+
"next-sitemap": "^4.2.3",
2956
"postcss": "^8",
3057
"tailwindcss": "^3.4.1"
58+
},
59+
"engines": {
60+
"node": ">=18.0.0",
61+
"npm": ">=8.0.0"
3162
}
3263
}

public/browserconfig.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<browserconfig>
3+
<msapplication>
4+
<tile>
5+
<square150x150logo src="/logo.png"/>
6+
<TileColor>#0070f3</TileColor>
7+
</tile>
8+
</msapplication>
9+
</browserconfig>

public/manifest.json

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
{
2+
"name": "SopKit - Professional Web Development Tools & Utilities",
3+
"short_name": "SopKit",
4+
"description": "Discover SopKit's powerful suite of free, open-source web development tools. Boost your productivity with our modern, efficient, and user-friendly development utilities.",
5+
"start_url": "/",
6+
"display": "standalone",
7+
"background_color": "#ffffff",
8+
"theme_color": "#0070f3",
9+
"orientation": "portrait-primary",
10+
"categories": ["developer", "productivity", "tools", "utilities"],
11+
"lang": "en-US",
12+
"icons": [
13+
{
14+
"src": "/logo.png",
15+
"sizes": "192x192",
16+
"type": "image/png",
17+
"purpose": "maskable any"
18+
},
19+
{
20+
"src": "/logo.png",
21+
"sizes": "512x512",
22+
"type": "image/png",
23+
"purpose": "maskable any"
24+
}
25+
],
26+
"screenshots": [
27+
{
28+
"src": "/og.png",
29+
"sizes": "1200x630",
30+
"type": "image/png",
31+
"form_factor": "wide",
32+
"label": "SopKit Homepage"
33+
}
34+
],
35+
"shortcuts": [
36+
{
37+
"name": "JSON Formatter",
38+
"short_name": "JSON",
39+
"description": "Format and validate JSON",
40+
"url": "/json-formatter",
41+
"icons": [{ "src": "/logo.png", "sizes": "96x96" }]
42+
},
43+
{
44+
"name": "HTML to JSX",
45+
"short_name": "JSX",
46+
"description": "Convert HTML to JSX",
47+
"url": "/html-to-jsx",
48+
"icons": [{ "src": "/logo.png", "sizes": "96x96" }]
49+
},
50+
{
51+
"name": "Markdown to HTML",
52+
"short_name": "Markdown",
53+
"description": "Convert Markdown to HTML",
54+
"url": "/markdown-to-html",
55+
"icons": [{ "src": "/logo.png", "sizes": "96x96" }]
56+
},
57+
{
58+
"name": "Encoding Tools",
59+
"short_name": "Encode",
60+
"description": "Various encoding tools",
61+
"url": "/encoding",
62+
"icons": [{ "src": "/logo.png", "sizes": "96x96" }]
63+
}
64+
]
65+
}

public/sw.js

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
const CACHE_NAME = 'sopkit-v1.0.0';
2+
const urlsToCache = [
3+
'/',
4+
'/about/',
5+
'/tools/',
6+
'/logo.png',
7+
'/og.png',
8+
'/manifest.json',
9+
// Add critical CSS and JS files
10+
'/_next/static/css/',
11+
'/_next/static/js/',
12+
// Tool pages
13+
'/markdown-to-html/',
14+
'/html-to-jsx/',
15+
'/encoding/',
16+
'/json-formatter/',
17+
'/html-to-markdown/',
18+
];
19+
20+
// Install event
21+
self.addEventListener('install', (event) => {
22+
event.waitUntil(
23+
caches.open(CACHE_NAME)
24+
.then((cache) => {
25+
console.log('Opened cache');
26+
return cache.addAll(urlsToCache);
27+
})
28+
);
29+
});
30+
31+
// Fetch event
32+
self.addEventListener('fetch', (event) => {
33+
event.respondWith(
34+
caches.match(event.request)
35+
.then((response) => {
36+
// Return cached version or fetch from network
37+
if (response) {
38+
return response;
39+
}
40+
return fetch(event.request).then(
41+
(response) => {
42+
// Check if valid response
43+
if (!response || response.status !== 200 || response.type !== 'basic') {
44+
return response;
45+
}
46+
47+
// Clone the response
48+
const responseToCache = response.clone();
49+
50+
caches.open(CACHE_NAME)
51+
.then((cache) => {
52+
cache.put(event.request, responseToCache);
53+
});
54+
55+
return response;
56+
}
57+
);
58+
})
59+
);
60+
});
61+
62+
// Activate event
63+
self.addEventListener('activate', (event) => {
64+
event.waitUntil(
65+
caches.keys().then((cacheNames) => {
66+
return Promise.all(
67+
cacheNames.map((cacheName) => {
68+
if (cacheName !== CACHE_NAME) {
69+
console.log('Deleting old cache:', cacheName);
70+
return caches.delete(cacheName);
71+
}
72+
})
73+
);
74+
})
75+
);
76+
});
77+
78+
// Background sync for offline functionality
79+
self.addEventListener('sync', (event) => {
80+
if (event.tag === 'background-sync') {
81+
console.log('Background sync triggered');
82+
// Handle background sync logic here
83+
}
84+
});
85+
86+
// Push notification handler
87+
self.addEventListener('push', (event) => {
88+
const options = {
89+
body: event.data ? event.data.text() : 'New update available!',
90+
icon: '/logo.png',
91+
badge: '/logo.png',
92+
vibrate: [100, 50, 100],
93+
data: {
94+
dateOfArrival: Date.now(),
95+
primaryKey: 1
96+
},
97+
actions: [
98+
{
99+
action: 'explore',
100+
title: 'Explore Tools',
101+
icon: '/logo.png'
102+
},
103+
{
104+
action: 'close',
105+
title: 'Close',
106+
icon: '/logo.png'
107+
}
108+
]
109+
};
110+
111+
event.waitUntil(
112+
self.registration.showNotification('SopKit Update', options)
113+
);
114+
});
115+
116+
// Notification click handler
117+
self.addEventListener('notificationclick', (event) => {
118+
event.notification.close();
119+
120+
if (event.action === 'explore') {
121+
event.waitUntil(
122+
clients.openWindow('https://sopkit.github.io/tools/')
123+
);
124+
}
125+
});

0 commit comments

Comments
 (0)