Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added:: Meta Tags, robots.txt, sitemaps for SEO Enhancement #217

Merged
merged 2 commits into from
Nov 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions chaosweb-v@2/generate-sitemap.js
Original file line number Diff line number Diff line change
@@ -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);
});
84 changes: 79 additions & 5 deletions chaosweb-v@2/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions chaosweb-v@2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
4 changes: 4 additions & 0 deletions chaosweb-v@2/public/robots.txt
myselfshivams marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
User-agent: *
Disallow: /private
Allow: /
Sitemap: https://chaosweb.vercel.app/sitemap.xml
1 change: 1 addition & 0 deletions chaosweb-v@2/public/sitemap.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<?xml version="1.0" encoding="UTF-8"?><urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:news="http://www.google.com/schemas/sitemap-news/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" xmlns:video="http://www.google.com/schemas/sitemap-video/1.1"><url><loc>https://chaosweb.vercel.app/</loc><changefreq>daily</changefreq><priority>1.0</priority></url></urlset>
2 changes: 2 additions & 0 deletions chaosweb-v@2/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -26,6 +27,7 @@ function App() {

return (
<Router>
<Metadata />
<div
onMouseEnter={handleJumpScare} // Triggers on hover
onClick={handleJumpScare} // Triggers on click
Expand Down
47 changes: 47 additions & 0 deletions chaosweb-v@2/src/metadata.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import React from "react";

const Metadata = () => {
return (
<>

<title>ChaosWeb</title>
<meta name="description" content="Welcome to ChaosWeb — a web design experiment where nothing behaves as it should, and everything is delightfully out of order! Explore unpredictable navigation, bizarre sliders, and a world where scrolling defies gravity." />
<meta name="keywords" content="web design, chaos, experiment, unpredictable, navigation, sliders" />
<meta name="author" content="Your Name" />
<meta name="robots" content="index, follow" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="canonical" href="https://chaosweb.vercel.app" />

<meta property="og:type" content="website" />
<meta property="og:title" content="ChaosWeb" />
<meta property="og:description" content="A web design experiment where nothing behaves as it should!" />
<meta property="og:image" content="URL_TO_IMAGE" />
<meta property="og:url" content="https://chaosweb.vercel.app" />
<meta property="og:site_name" content="ChaosWeb" />
<meta property="og:locale" content="en_US" />


<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:title" content="ChaosWeb" />
<meta name="twitter:description" content="A web design experiment where nothing behaves as it should!" />
<meta name="twitter:image" content="URL_TO_IMAGE" />
<meta name="twitter:site" content="@YourTwitterHandle" />
<meta name="twitter:creator" content="@YourTwitterHandle" />

<meta name="theme-color" content="#ffffff" />
<meta name="apple-mobile-web-app-title" content="ChaosWeb" />
<meta name="application-name" content="ChaosWeb" />
<meta name="msapplication-TileColor" content="#ffffff" />
<meta name="msapplication-config" content="/browserconfig.xml" />
<meta name="apple-mobile-web-app-status-bar-style" content="default" />


<link rel="icon" href="/favicon.ico" sizes="any" />
<link rel="icon" href="/favicon.svg" type="image/svg+xml" />
<link rel="apple-touch-icon" href="/apple-touch-icon.png" />
<link rel="manifest" href="/manifest.json" />
</>
);
};

export default Metadata;
12 changes: 12 additions & 0 deletions node_modules/.package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading