diff --git a/README.md b/README.md index 0ccb02e10e3b7f1fc3fbb22b839edad3a0cf2ac9..4341f09ccdeca7020f97cf5203dfd2d9e685f816 100644 --- a/README.md +++ b/README.md @@ -1 +1,17 @@ -React js b2c application initial \ No newline at end of file +React js b2c application initial + +/src + ├── /components + │ ├── Navbar.js + │ ├── HeroSection.js + │ ├── DealsSection.js + │ ├── HotelsSection.js + │ ├── DestinationsSection.js + │ ├── TrendingSearches.js + │ ├── Footer.js + ├── /pages + │ ├── Home.js + ├── /config + │ ├── api.js (for Sabre API calls) + ├── App.js + ├── index.js \ No newline at end of file diff --git a/package.json b/package.json index 3ce8873ba261865411013a1dd64d0c9fd567c2d1..1348d063e33a4d735731f6ff3bc1abfe1332df52 100644 --- a/package.json +++ b/package.json @@ -5,10 +5,11 @@ "description": "React js b2c application initial", "main": "index.js", "scripts": { - "start": "PORT=8080 react-scripts start", + "dev": "PORT=8080 react-scripts start", "build": "react-scripts build", "test": "react-scripts test", - "eject": "react-scripts eject" + "eject": "react-scripts eject", + "generate-sitemap": "node scripts/generateSitemap.js" }, "repository": { "type": "git", @@ -20,10 +21,13 @@ "dependencies": { "axios": "^1.8.4", "bootstrap": "^5.3.3", + "fs": "^0.0.1-security", "react": "^19.1.0", "react-dom": "^19.1.0", + "react-helmet": "^6.1.0", "react-router-dom": "^7.4.1", - "react-scripts": "^5.0.1" + "react-scripts": "^5.0.1", + "sitemap": "^8.0.0" }, "browserslist": { "production": [ diff --git a/public/robots.txt b/public/robots.txt new file mode 100644 index 0000000000000000000000000000000000000000..4cec90cc26b9428de28d4d89eb649209579c0512 --- /dev/null +++ b/public/robots.txt @@ -0,0 +1,3 @@ +User-agent: * +Allow: / +Sitemap: https://www.uat.hlafly.com/sitemap.xml diff --git a/scripts/generateSitemap.js b/scripts/generateSitemap.js new file mode 100644 index 0000000000000000000000000000000000000000..94900297feadfbe91d9d625c35049af2452d30d4 --- /dev/null +++ b/scripts/generateSitemap.js @@ -0,0 +1,24 @@ +import { createWriteStream } from "fs"; +import { SitemapStream, streamToPromise } from "sitemap"; + +const generateSitemap = async () => { + const sitemap = new SitemapStream({ hostname: "https://www.hlafly.com" }); + + const pages = [ + { url: "/", changefreq: "daily", priority: 1.0 }, + { url: "/flights", changefreq: "weekly", priority: 0.8 }, + { url: "/hotels", changefreq: "weekly", priority: 0.8 }, + { url: "/packages", changefreq: "weekly", priority: 0.7 }, + ]; + + const writeStream = createWriteStream("public/sitemap.xml"); + sitemap.pipe(writeStream); + + pages.forEach((page) => sitemap.write(page)); + sitemap.end(); + + await streamToPromise(sitemap); + console.log("✅ Sitemap successfully generated!"); +}; + +generateSitemap(); diff --git a/src/App.js b/src/App.js index 1eb4e6cd1ea91c4e614ebe5a178ee37c588749d0..9a23a6e097a6311492059b8955f81bb63549cd4d 100644 --- a/src/App.js +++ b/src/App.js @@ -8,15 +8,22 @@ import Hotels from "./pages/Hotels.js"; import Packages from "./pages/Packages.js"; import Navbar from "./components/Navbar.js"; import Footer from "./components/Footer.js"; +import FlightsResults from "./pages/FlightsResults.js"; // results page + function App() { return ( <> - Chalpado - Best Travel Deals - + hlafly - Best Travel Deals + + + + + +
@@ -25,11 +32,12 @@ function App() { } /> } /> } /> + } />