From 8a490b8fa94a006deaad33acd8a2bbde912e2073 Mon Sep 17 00:00:00 2001 From: Shivam <143623476+myselfshivams@users.noreply.github.com> Date: Sat, 2 Nov 2024 23:20:08 +0530 Subject: [PATCH 1/2] added:: Meta Tags, robots.txt, sitemaps for SEO Enhancement --- chaosweb-v@2/generate-sitemap.js | 21 ++++++++ chaosweb-v@2/package-lock.json | 84 ++++++++++++++++++++++++++++++-- chaosweb-v@2/package.json | 2 + chaosweb-v@2/public/robots.txt | 4 ++ chaosweb-v@2/public/sitemap.xml | 1 + chaosweb-v@2/src/App.jsx | 2 + chaosweb-v@2/src/metadata.jsx | 47 ++++++++++++++++++ 7 files changed, 156 insertions(+), 5 deletions(-) create mode 100644 chaosweb-v@2/generate-sitemap.js create mode 100644 chaosweb-v@2/public/robots.txt create mode 100644 chaosweb-v@2/public/sitemap.xml create mode 100644 chaosweb-v@2/src/metadata.jsx diff --git a/chaosweb-v@2/generate-sitemap.js b/chaosweb-v@2/generate-sitemap.js new file mode 100644 index 0000000..2129714 --- /dev/null +++ b/chaosweb-v@2/generate-sitemap.js @@ -0,0 +1,21 @@ +import { SitemapStream } from 'sitemap'; +import { createWriteStream } from 'fs'; +import path from 'path'; +import { fileURLToPath } from 'url'; +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); +const pages = [ + { url: '/', changefreq: 'daily', priority: 1.0 }, + ]; +async function generateSitemap() { + const writeStream = createWriteStream(path.resolve(__dirname, 'public', 'sitemap.xml')); + const sitemap = new SitemapStream({ hostname: 'https://chaosweb.vercel.app/' }); + sitemap.pipe(writeStream).on('finish', () => { + console.log('Sitemap generated successfully'); + }); + pages.forEach(page => sitemap.write(page)); + sitemap.end(); +} +generateSitemap().catch(error => { + console.error('Error generating sitemap:', error); +}); \ No newline at end of file diff --git a/chaosweb-v@2/package-lock.json b/chaosweb-v@2/package-lock.json index 7842b44..f055b59 100644 --- a/chaosweb-v@2/package-lock.json +++ b/chaosweb-v@2/package-lock.json @@ -14,9 +14,11 @@ "react-confetti": "^6.1.0", "react-dom": "^18.3.1", "react-fireworks": "^1.0.4", + "react-helmet": "^6.1.0", "react-router-dom": "^6.27.0", "react-slick": "^0.30.2", "react-tsparticles": "^2.12.2", + "sitemap": "^8.0.0", "slick-carousel": "^1.8.1" }, "devDependencies": { @@ -1276,6 +1278,14 @@ "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", "dev": true }, + "node_modules/@types/node": { + "version": "22.8.6", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.8.6.tgz", + "integrity": "sha512-tosuJYKrIqjQIlVCM4PEGxOmyg3FCPa/fViuJChnGeEIhjA46oy8FMVoF9su1/v8PNs2a8Q0iFNyOx0uOF91nw==", + "dependencies": { + "undici-types": "~6.19.8" + } + }, "node_modules/@types/prop-types": { "version": "15.7.13", "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.13.tgz", @@ -1301,6 +1311,14 @@ "@types/react": "*" } }, + "node_modules/@types/sax": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/@types/sax/-/sax-1.2.7.tgz", + "integrity": "sha512-rO73L89PJxeYM3s3pPPjiPgVVcymqU490g0YO5n5By0k2Erzj6tay/4lr1CHAAU4JyOWd1rpQ8bCf6cZfHU96A==", + "dependencies": { + "@types/node": "*" + } + }, "node_modules/@vitejs/plugin-react": { "version": "4.3.2", "resolved": "https://registry.npmjs.org/@vitejs/plugin-react/-/plugin-react-4.3.2.tgz", @@ -1407,7 +1425,6 @@ "version": "5.0.2", "resolved": "https://registry.npmjs.org/arg/-/arg-5.0.2.tgz", "integrity": "sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg==", - "dev": true, "license": "MIT" }, "node_modules/argparse": { @@ -3737,7 +3754,6 @@ "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", - "dev": true, "engines": { "node": ">=0.10.0" } @@ -4196,7 +4212,6 @@ "version": "15.8.1", "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz", "integrity": "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==", - "dev": true, "dependencies": { "loose-envify": "^1.4.0", "object-assign": "^4.1.1", @@ -4271,17 +4286,35 @@ "react": "^18.3.1" } }, + "node_modules/react-fast-compare": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/react-fast-compare/-/react-fast-compare-3.2.2.tgz", + "integrity": "sha512-nsO+KSNgo1SbJqJEYRE9ERzo7YtYbou/OqjSQKxV7jcKox7+usiUVZOAC+XnDOABXggQTno0Y1CpVnuWEc1boQ==" + }, "node_modules/react-fireworks": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/react-fireworks/-/react-fireworks-1.0.4.tgz", "integrity": "sha512-jj1a+HTicB4pR6g2lqhVyAox0GTE0TOrZK2XaJFRYOwltgQWeYErZxnvU9+zH/blY+Hpmu9IKyb39OD3KcCMJw==", "license": "ISC" }, + "node_modules/react-helmet": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/react-helmet/-/react-helmet-6.1.0.tgz", + "integrity": "sha512-4uMzEY9nlDlgxr61NL3XbKRy1hEkXmKNXhjbAIOVw5vcFrsdYbH2FEwcNyWvWinl103nXgzYNlns9ca+8kFiWw==", + "dependencies": { + "object-assign": "^4.1.1", + "prop-types": "^15.7.2", + "react-fast-compare": "^3.1.1", + "react-side-effect": "^2.1.0" + }, + "peerDependencies": { + "react": ">=16.3.0" + } + }, "node_modules/react-is": { "version": "16.13.1", "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", - "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==", - "dev": true + "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" }, "node_modules/react-refresh": { "version": "0.14.2", @@ -4322,6 +4355,14 @@ "react-dom": ">=16.8" } }, + "node_modules/react-side-effect": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/react-side-effect/-/react-side-effect-2.1.2.tgz", + "integrity": "sha512-PVjOcvVOyIILrYoyGEpDN3vmYNLdy1CajSFNt4TDsVQC5KpTijDvWVoR+/7Rz2xT978D8/ZtFceXxzsPwZEDvw==", + "peerDependencies": { + "react": "^16.3.0 || ^17.0.0 || ^18.0.0" + } + }, "node_modules/react-slick": { "version": "0.30.2", "resolved": "https://registry.npmjs.org/react-slick/-/react-slick-0.30.2.tgz", @@ -4566,6 +4607,11 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/sax": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/sax/-/sax-1.4.1.tgz", + "integrity": "sha512-+aWOz7yVScEGoKNd4PA10LZ8sk0A/z5+nXQG5giUO5rprX9jgYsTdov9qCchZiPIZezbZH+jRut8nPodFAX4Jg==" + }, "node_modules/scheduler": { "version": "0.23.2", "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.2.tgz", @@ -4667,6 +4713,29 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/sitemap": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/sitemap/-/sitemap-8.0.0.tgz", + "integrity": "sha512-+AbdxhM9kJsHtruUF39bwS/B0Fytw6Fr1o4ZAIAEqA6cke2xcoO2GleBw9Zw7nRzILVEgz7zBM5GiTJjie1G9A==", + "dependencies": { + "@types/node": "^17.0.5", + "@types/sax": "^1.2.1", + "arg": "^5.0.0", + "sax": "^1.2.4" + }, + "bin": { + "sitemap": "dist/cli.js" + }, + "engines": { + "node": ">=14.0.0", + "npm": ">=6.0.0" + } + }, + "node_modules/sitemap/node_modules/@types/node": { + "version": "17.0.45", + "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.45.tgz", + "integrity": "sha512-w+tIMs3rq2afQdsPJlODhoUEKzFP1ayaoyl1CcnwtIlsVe7K7bA1NGm4s3PraqTLlXnbIN84zuBlxBWo1u9BLw==" + }, "node_modules/slick-carousel": { "version": "1.8.1", "resolved": "https://registry.npmjs.org/slick-carousel/-/slick-carousel-1.8.1.tgz", @@ -5186,6 +5255,11 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/undici-types": { + "version": "6.19.8", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz", + "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==" + }, "node_modules/update-browserslist-db": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.1.tgz", diff --git a/chaosweb-v@2/package.json b/chaosweb-v@2/package.json index 0d1140f..755b8fd 100644 --- a/chaosweb-v@2/package.json +++ b/chaosweb-v@2/package.json @@ -16,9 +16,11 @@ "react-confetti": "^6.1.0", "react-dom": "^18.3.1", "react-fireworks": "^1.0.4", + "react-helmet": "^6.1.0", "react-router-dom": "^6.27.0", "react-slick": "^0.30.2", "react-tsparticles": "^2.12.2", + "sitemap": "^8.0.0", "slick-carousel": "^1.8.1" }, "devDependencies": { diff --git a/chaosweb-v@2/public/robots.txt b/chaosweb-v@2/public/robots.txt new file mode 100644 index 0000000..a86b9fd --- /dev/null +++ b/chaosweb-v@2/public/robots.txt @@ -0,0 +1,4 @@ +User-agent: * +Disallow: /private +Allow: / +Sitemap: https://social-media-management-djkz.vercel.app/sitemap.xml \ No newline at end of file diff --git a/chaosweb-v@2/public/sitemap.xml b/chaosweb-v@2/public/sitemap.xml new file mode 100644 index 0000000..ee94b65 --- /dev/null +++ b/chaosweb-v@2/public/sitemap.xml @@ -0,0 +1 @@ +https://chaosweb.vercel.app/daily1.0 \ No newline at end of file diff --git a/chaosweb-v@2/src/App.jsx b/chaosweb-v@2/src/App.jsx index bcf71b6..ecb7012 100644 --- a/chaosweb-v@2/src/App.jsx +++ b/chaosweb-v@2/src/App.jsx @@ -14,6 +14,7 @@ import JumpScareEffect from "./components/JumpScareEffect"; import BarrelRoll from "./pages/BarrelRoll"; import RateUs from "./pages/RateUs"; import TestEffects from "./pages/TestEffects"; +import Metadata from "./metadata"; function App() { const [trigger, setTrigger] = useState(false); @@ -26,6 +27,7 @@ function App() { return ( +
{ + return ( + <> + + ChaosWeb + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ); +}; + +export default Metadata; From 24047e46180470b365bbc6ca5a6a82f93b6519d5 Mon Sep 17 00:00:00 2001 From: Shivam <143623476+myselfshivams@users.noreply.github.com> Date: Sat, 2 Nov 2024 23:57:08 +0530 Subject: [PATCH 2/2] fixed:: link --- chaosweb-v@2/public/robots.txt | 2 +- node_modules/.package-lock.json | 12 ++++++++++++ package-lock.json | 4 ++++ 3 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 node_modules/.package-lock.json diff --git a/chaosweb-v@2/public/robots.txt b/chaosweb-v@2/public/robots.txt index a86b9fd..1b7e573 100644 --- a/chaosweb-v@2/public/robots.txt +++ b/chaosweb-v@2/public/robots.txt @@ -1,4 +1,4 @@ User-agent: * Disallow: /private Allow: / -Sitemap: https://social-media-management-djkz.vercel.app/sitemap.xml \ No newline at end of file +Sitemap: https://chaosweb.vercel.app/sitemap.xml \ No newline at end of file diff --git a/node_modules/.package-lock.json b/node_modules/.package-lock.json new file mode 100644 index 0000000..b0fee0a --- /dev/null +++ b/node_modules/.package-lock.json @@ -0,0 +1,12 @@ +{ + + "name": "ChaosWeb", + + "lockfileVersion": 3, + + "requires": true, + + "packages": {} + +} + diff --git a/package-lock.json b/package-lock.json index f7de2e5..b0fee0a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3,6 +3,10 @@ "name": "ChaosWeb", "lockfileVersion": 3, + "requires": true, + "packages": {} + } +