Skip to content

Commit

Permalink
Merge pull request #153 from KGupta2601/main
Browse files Browse the repository at this point in the history
added generate-sitemap.js, robots.txt, sitemap.xml, metadata.jsx
  • Loading branch information
jinx-vi-0 authored Nov 8, 2024
2 parents 3828594 + eb78e1e commit 309ca3f
Show file tree
Hide file tree
Showing 6 changed files with 135 additions and 4 deletions.
43 changes: 43 additions & 0 deletions generate-sitemap.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
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);

// Define the pages you want to include in the sitemap
const pages = [
{ url: '/', changefreq: 'daily', priority: 1.0 },
{ url: '/sign-in', changefreq: 'monthly', priority: 0.8 },
{ url: '/sign-up', changefreq: 'monthly', priority: 0.8 },
{ url: '/manager', changefreq: 'monthly', priority: 0.9 },
{ url: '/issues', changefreq: 'weekly', priority: 0.6 }, // GitHub issues page
{ url: '/pulls', changefreq: 'weekly', priority: 0.6 }, // GitHub pull requests page
{ url: '/#readme', changefreq: 'monthly', priority: 0.7 }, // README section
// Add more URLs as needed
];

async function generateSitemap() {
// Create a write stream to save the sitemap.xml file
const writeStream = createWriteStream(path.resolve(__dirname, 'public', 'sitemap.xml'));

// Create a new SitemapStream with your website's hostname
const sitemap = new SitemapStream({ hostname: 'https://github.com/jinx-vi-0/passop' });

// Pipe the sitemap to the write stream and log success message on finish
sitemap.pipe(writeStream).on('finish', () => {
console.log('Sitemap generated successfully');
});

// Write each page to the sitemap
pages.forEach(page => sitemap.write(page));

// End the sitemap stream
sitemap.end();
}

// Execute the generateSitemap function and catch any errors
generateSitemap().catch(error => {
console.error('Error generating sitemap:', error);
});
17 changes: 16 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,25 @@
<meta charset="UTF-8" />
<link rel="icon" type="image/png" href="/favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>PassOP - Your own password manager</title>
<title>PassOP - Your Secure Password Manager</title>

<!-- Meta Tags -->
<meta name="description" content="PassOP is a simple and secure password manager built with React. Save, view, edit, and delete your passwords efficiently and securely." />
<meta name="keywords" content="password manager, secure passwords, React, web application" />

<!-- Open Graph Tags -->
<meta property="og:title" content="PassOP - Your Secure Password Manager" />
<meta property="og:description" content="Manage your passwords securely with PassOP." />
<meta property="og:url" content="https://github.com/jinx-vi-0/passop" /> <!-- Replace with actual page URL -->
<meta property="og:type" content="website" />

<!-- Robots Meta Tag -->
<meta name="robots" content="index, follow">
</head>
<body>
<div id="root"></div>

<!-- Scripts -->
<script src="https://cdn.lordicon.com/lordicon.js"></script>
<script type="module" src="/src/main.jsx"></script>
</body>
Expand Down
4 changes: 4 additions & 0 deletions public/robots.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
User-agent: *
Disallow: /private/
Allow: /
Sitemap: https://github.com/jinx-vi-0/passop/sitemap.xml
28 changes: 28 additions & 0 deletions public/sitemap.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>

<url>
<loc>https://github.com/jinx-vi-0/passop</loc>
<lastmod>2024-11-08</lastmod>
<changefreq>monthly</changefreq>
<priority>1.0</priority>
</url>
<url>
<loc>https://github.com/jinx-vi-0/passop#readme</loc>
<lastmod>2024-11-08</lastmod>
<changefreq>monthly</changefreq>
<priority>0.8</priority>
</url>
<url>
<loc>https://github.com/jinx-vi-0/passop/issues</loc>
<lastmod>2024-11-08</lastmod>
<changefreq>weekly</changefreq>
<priority>0.6</priority>
</url>
<url>
<loc>https://github.com/jinx-vi-0/passop/pulls</loc>
<lastmod>2024-11-08</lastmod>
<changefreq>weekly</changefreq>
<priority>0.6</priority>
</url>
<!-- Add more URLs as needed -->
</urlset>
7 changes: 4 additions & 3 deletions src/App.jsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

import { BrowserRouter as Router, Route, Routes, Navigate } from 'react-router-dom';
import { useState } from 'react';
import './App.css';
Expand All @@ -6,10 +7,12 @@ import Manager from './components/Manager';
import Footer from './components/Footer';
import SignIn from './components/SignIn';
import SignUp from './components/SignUp';
import Metadata from './metadata'; // Import the Metadata component

function App() {
return (
<Router>
<Metadata /> {/* Add Metadata component here */}
<Navbar />
<div className="bg-green-50 bg-[linear-gradient(to_right,#8080800a_1px,transparent_1px),linear-gradient(to_bottom,#8080800a_1px,transparent_1px)] bg-[size:14px_24px]">
<Routes>
Expand All @@ -25,6 +28,4 @@ function App() {
);
}



export default App;
export default App;
40 changes: 40 additions & 0 deletions src/metadata.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import React from 'react';
import { Helmet } from 'react-helmet';

const Metadata = () => {
return (
<Helmet>
<title>PassOP - Your Secure Password Manager</title>
<meta name="description" content="PassOP is a simple and secure password manager built with React. Save, view, edit, and delete your passwords efficiently and securely." />
<meta name="keywords" content="password manager, secure passwords, React, web application" />
<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://github.com/jinx-vi-0/passop" />

{/* Open Graph Tags */}
<meta property="og:type" content="website" />
<meta property="og:title" content="PassOP - Your Secure Password Manager" />
<meta property="og:description" content="Manage your passwords securely with PassOP." />
<meta property="og:image" content="URL_TO_IMAGE" />
<meta property="og:url" content="https://github.com/jinx-vi-0/passop" />
<meta property="og:site_name" content="PassOP" />
<meta property="og:locale" content="en_US" />

{/* Twitter Card Tags */}
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:title" content="PassOP - Your Secure Password Manager" />
<meta name="twitter:description" content="Manage your passwords securely with PassOP." />
<meta name="twitter:image" content="URL_TO_IMAGE" />
<meta name="twitter:site" content="@YourTwitterHandle" />
<meta name="twitter:creator" content="@YourTwitterHandle" />

{/* Theme and Application Metadata */}
<meta name="theme-color" content="#ffffff" />
<link rel="icon" href="/favicon.ico" sizes="any"/>
<link rel="icon" href="/favicon.svg" type="image/svg+xml"/>
</Helmet>
);
};

export default Metadata;

0 comments on commit 309ca3f

Please sign in to comment.