-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #153 from KGupta2601/main
added generate-sitemap.js, robots.txt, sitemap.xml, metadata.jsx
- Loading branch information
Showing
6 changed files
with
135 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |