-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d2be756
commit a887d02
Showing
10 changed files
with
85 additions
and
2 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,27 @@ | ||
import { SitemapStream, streamToPromise } from 'sitemap'; | ||
import { createWriteStream } from 'fs'; | ||
import { fileURLToPath } from 'url'; | ||
import path from 'path'; | ||
|
||
// Create __dirname for ES modules | ||
const __filename = fileURLToPath(import.meta.url); | ||
const __dirname = path.dirname(__filename); | ||
|
||
// Resolve the path to sitemap.xml | ||
const sitemapPath = path.resolve(__dirname, 'public', 'sitemap.xml'); | ||
|
||
const sitemap = new SitemapStream({ hostname: 'https://capusify.site' }); | ||
|
||
const links = [ | ||
{ url: '/', changefreq: 'daily', priority: 1.0 }, | ||
{ url: '/about', changefreq: 'weekly', priority: 0.8 }, | ||
{ url: '/contact', changefreq: 'monthly', priority: 0.5 } | ||
]; | ||
|
||
links.forEach(link => sitemap.write(link)); | ||
sitemap.end(); | ||
|
||
// Create the sitemap and handle errors | ||
streamToPromise(sitemap.pipe(createWriteStream(sitemapPath))) | ||
.then(() => console.log('Sitemap created successfully!')) | ||
.catch(err => console.error('Error generating sitemap:', err)); |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
0
frontend/src/robots.txt → frontend/public/sitemap.xml
100644 → 100755
File renamed without changes.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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: | ||
|
||
Sitemap: https://capusify.site/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
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 |
---|---|---|
@@ -1,4 +1,10 @@ | ||
import React from "react"; | ||
import ReactDOM from "react-dom/client"; | ||
import { HelmetProvider } from 'react-helmet-async'; | ||
import App from "./App.jsx"; | ||
ReactDOM.createRoot(document.getElementById("root")).render(<App />); | ||
ReactDOM.createRoot(document.getElementById("root")).render( | ||
<HelmetProvider> | ||
<App /> | ||
</HelmetProvider> | ||
|
||
); |