diff --git a/components/sections/home2/Banner.js b/components/sections/home2/Banner.js index 30410c4..b918ad4 100644 --- a/components/sections/home2/Banner.js +++ b/components/sections/home2/Banner.js @@ -1,5 +1,5 @@ 'use client' -import React, { useState, useEffect } from 'react'; +import React, { useState } from 'react'; import Link from "next/link"; import { Autoplay, Navigation, Pagination } from "swiper/modules"; import { Swiper, SwiperSlide } from "swiper/react"; @@ -61,71 +61,10 @@ export default function Banner() { const [activeIndex, setActiveIndex] = useState(0); const [isAnimating, setIsAnimating] = useState(false); - const slides = [ - { - id: 0, - variant: 'topToBottom', - bgImage: '/assets/images/banner/desktopBanner/home-banner-1.webp', - upperText: 'Begin Your Health Journey', - title: 'Better', - titleSpan: 'health', - titleEnd: 'Forever', - // subtitle: 'Expert Physiotherapy in Mississauga for You.', - description: 'Our expert physiotherapists help you restore movement, reduce pain, and live healthier with personalized care in Mississauga.', - buttonText: 'Book Your Appointment', - buttonLink: 'tel:+647-722-3434', - // contentStyle: 'mobile-style' - }, - { - id: 1, - variant: 'bottomToTop', - bgImage: '/assets/images/banner/desktopBanner/home-banner-2.webp', - upperText: 'Care That Heals Gently', - title: 'Relaxing', - titleSpan: 'Massage', - titleEnd: 'Therapy', - // subtitle: 'Expert Hand Massage Techniques for Relief', - description: 'Experience soothing massage techniques that release tension, promote circulation, and support your overall wellness.', - buttonText: 'Schedule a Massage', - buttonLink: '/contact', - // contentStyle: 'with-background' - }, - { - id: 2, - variant: 'leftToRight', - bgImage: '/assets/images/banner/desktopBanner/home-banner-3.webp', - upperText: 'Wellness Near You Always', - title: 'Trusted', - titleSpan: 'Physio', - titleEnd: 'Experts', - // subtitle: 'Physiotherapy Etobicoke & Rehab Care.', - description: 'Comprehensive physiotherapy and rehab services designed to restore your strength, mobility, and long-term wellness.', - buttonText: 'Explore Our Service', - buttonLink: '/etobicoke-treatment-service', - // contentStyle: 'with-background' - }, - { - id: 3, - variant: 'rightToLeft', - bgImage: '/assets/images/banner/desktopBanner/home-banner-4.webp', - upperText: 'Healing With Caring Hands', - title: 'Holistic', - titleSpan: 'Wellness', - titleEnd: 'Care', - // subtitle: 'Waterfront Physio and Rehab Services.', - description: 'Discover holistic physiotherapy and rehab services designed to restore balance, ease pain, and support long-term recovery.', - buttonText: 'Visit Our Location', - buttonLink: '/contact', - // contentStyle: 'with-background' - } - ]; - const handleSlideChange = (swiper) => { setIsAnimating(true); setActiveIndex(swiper.realIndex || 0); - setTimeout(() => { - setIsAnimating(false); - }, 1200); + setTimeout(() => setIsAnimating(false), 1200); }; return ( @@ -133,69 +72,142 @@ export default function Banner() { { - setActiveIndex(swiper.realIndex || 0); - }} + onSwiper={(swiper) => setActiveIndex(swiper.realIndex || 0)} onSlideChange={handleSlideChange} > - {slides.map((slide, index) => ( - - - {activeIndex === index && ( - -
-
-
- - {slide.upperText} - + {/* Slide 1 */} + + + {activeIndex === 0 && ( + +
+
+
+ {/*
+ Begin Your Health Journey +

Better health Forever

+

Our expert physiotherapists help you restore movement, reduce pain, and live healthier with personalized care in Mississauga.

+
+ + Book Your Appointment + +
+
*/} +
+
+ )} +
+
-

- {slide.title} {slide.titleSpan} {slide.titleEnd} -

- -

- {slide.subtitle} -

- -

- {slide.description} -

- -
- - {slide.buttonText} - -
+ {/* Slide 2 */} + + + {activeIndex === 1 && ( + +
+
+
+
+ Care That Heals Gently +

Relaxing Massage Therapy

+

Experience soothing massage techniques that release tension, promote circulation, and support your overall wellness.

+
+ + Schedule a Massage +
- - )} - - - ))} +
+
+ )} +
+
+ + {/* Slide 3 */} + + + {activeIndex === 2 && ( + +
+
+
+
+ Wellness Near You Always +

Trusted Physio Experts

+

Comprehensive physiotherapy and rehab services designed to restore your strength, mobility, and long-term wellness.

+
+ + Explore Our Service + +
+
+
+
+ )} +
+
+ + {/* Slide 4 */} + + + {activeIndex === 3 && ( + +
+
+
+
+ Healing With Caring Hands +

Holistic Wellness Care

+

Discover holistic physiotherapy and rehab services designed to restore balance, ease pain, and support long-term recovery.

+
+ + Visit Our Location + +
+
+
+
+ )} +
+
+ ); -}; +} diff --git a/public/assets/css/style.css b/public/assets/css/style.css index 83730ef..26c116f 100644 --- a/public/assets/css/style.css +++ b/public/assets/css/style.css @@ -1015,32 +1015,32 @@ } /* Fully transparent header */ -.header-style-two, -.header-style-two .header-top, -.header-style-two .header-area { - background: transparent !important; - box-shadow: none !important; - border: none !important; - position: absolute; - top: 0; - left: 0; - width: 100%; - z-index: 999; -} + .header-style-two, + .header-style-two .header-top, + .header-style-two .header-area { + background: transparent !important; + box-shadow: none !important; + border: none !important; + position: absolute; + top: 0; + left: 0; + width: 100%; + z-index: 999; + } -.header-style-two .header-top a, -.header-style-two .header-top .logo { - color: #bc0000 !important; -} + .header-style-two .header-top a, + .header-style-two .header-top .logo { + color: #bc0000 !important; + } -.header-style-two .header-top .top-inner { - display: flex; - justify-content: space-between; - align-items: center; - padding-left: 100px; - padding-right: 100px; - position: relative; -} + .header-style-two .header-top .top-inner { + display: flex; + justify-content: space-between; + align-items: center; + padding-left: 100px; + padding-right: 100px; + position: relative; + } .header-top .top-inner { @@ -1264,7 +1264,7 @@ width: 100%; } */ - .main-header .header-lower .outer-container { + .main-header .header-lower .outer-container { position: absolute; left: 0px; top: 0px; @@ -1274,11 +1274,12 @@ .main-header .header-lower .outer-box { position: relative; /* background: #fff; */ + border-top: 1px solid #1025487a; } - - .new{ - background-color: #fff !important; + .new { + + background-color: #fff !important; } @@ -1475,9 +1476,9 @@ transition: all 500ms ease; } - .new-menu .new-nav>li>a{ + .new-menu .new-nav>li>a { - color: #bc0000 !important; + color: #bc0000 !important; } @@ -2754,6 +2755,7 @@ position: relative; padding-left: 100px; padding-right: 100px; + /* background: #bc000036 !important; */ } @media only screen and (max-width: 1200px) { @@ -3355,20 +3357,20 @@ background: none; } -@media (min-width: 768px) and (max-width: 1024px) { - .custom-content-box.mobile-style { - top: 190px; - background: white; - border-radius: 15%; - opacity: 0.8; - } -} + @media (min-width: 768px) and (max-width: 1024px) { + .custom-content-box.mobile-style { + top: 190px; + background: white; + border-radius: 15%; + opacity: 0.8; + } + } -@media (min-width: 768px) and (max-width: 991px) { - .custom-content-box.with-background { - top: 170px; - } -} + @media (min-width: 768px) and (max-width: 991px) { + .custom-content-box.with-background { + top: 170px; + } + } @media (max-width: 425px) { .custom-content-box.mobile-style { @@ -3467,16 +3469,17 @@ @media (max-width: 1024px) and (min-width: 769px) { - .header-style-two .header-top .top-inner { - display: flex; - justify-content: space-between; - align-items: center; - padding-left: 0px !important; - padding-right: 0px !important; - position: relative; /* Needed for flex children alignment */ -} + .header-style-two .header-top .top-inner { + display: flex; + justify-content: space-between; + align-items: center; + padding-left: 0px !important; + padding-right: 0px !important; + position: relative; + /* Needed for flex children alignment */ + } + - .info-block-one { padding: 30px 7px !important; } @@ -3484,15 +3487,17 @@ @media (max-width: 768px) { - .header-style-two .header-top .top-inner { - display: flex; - justify-content: space-between; - justify-content: center; - align-items: center; - padding-left: 100px; - padding-right: 100px; - position: relative; /* Needed for flex children alignment */ -} + .header-style-two .header-top .top-inner { + display: flex; + justify-content: space-between; + justify-content: center; + align-items: center; + padding-left: 100px; + padding-right: 100px; + position: relative; + /* Needed for flex children alignment */ + } + .blog-details-content .news-block-one .inner-box .lower-content h2 { font-size: 38px !important; line-height: 36px; @@ -3546,29 +3551,33 @@ } .loader-wrap { - position: fixed; - top: 0; - left: 0; - width: 100%; - height: 100%; - background: #ffffff; - display: flex; - align-items: center; - justify-content: center; - z-index: 9999; -} + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + background: #ffffff; + display: flex; + align-items: center; + justify-content: center; + z-index: 9999; + } -.preloader { - text-align: center; -} + .preloader { + text-align: center; + } -.preloader-icon { - font-size: 50px; - animation: spin 1.5s linear infinite; -} + .preloader-icon { + font-size: 50px; + animation: spin 1.5s linear infinite; + } -@keyframes spin { - 0% { transform: rotate(0deg); } - 100% { transform: rotate(360deg); } -} + @keyframes spin { + 0% { + transform: rotate(0deg); + } + 100% { + transform: rotate(360deg); + } + } \ No newline at end of file diff --git a/public/sitemap.xml b/public/sitemap.xml index d877bfe..05943fe 100644 --- a/public/sitemap.xml +++ b/public/sitemap.xml @@ -1 +1 @@ -https://rapharehap.metatronnest.com/about-us/weekly0.8https://rapharehap.metatronnest.com/accident/weekly0.8https://rapharehap.metatronnest.com/accident/[slug]/weekly0.8https://rapharehap.metatronnest.com/area-of-injury/weekly0.8https://rapharehap.metatronnest.com/area-of-injury/[slug]/weekly0.8https://rapharehap.metatronnest.com/blog/weekly0.8https://rapharehap.metatronnest.com/blog/[slug]/weekly0.8https://rapharehap.metatronnest.com/caregivers/weekly0.8https://rapharehap.metatronnest.com/contact/weekly0.8https://rapharehap.metatronnest.com/covid-19-updates/weekly0.8https://rapharehap.metatronnest.com/etobicoke-treatment-service/weekly0.8https://rapharehap.metatronnest.com/etobicoke-treatment-service/[slug]/weekly0.8https://rapharehap.metatronnest.com/faq-physiotherapy-etobicoke/weekly0.8https://rapharehap.metatronnest.com/gallery-physiotherapy-etobicoke/weekly0.8https://rapharehap.metatronnest.com/locations/weekly0.8https://rapharehap.metatronnest.com/our-team-physiotherapy-etobicoke/weekly0.8https://rapharehap.metatronnest.com/our-team-physiotherapy-etobicoke/[slug]/weekly0.8https://rapharehap.metatronnest.com/ourapproach-physiotherapy-etobicoke/weekly0.8https://rapharehap.metatronnest.com/weekly1.0https://rapharehap.metatronnest.com/payment-insurance/weekly0.8https://rapharehap.metatronnest.com/rehabilitation/weekly0.8https://rapharehap.metatronnest.com/rehabilitation/[slug]/weekly0.8https://rapharehap.metatronnest.com/shortcodes/weekly0.8https://rapharehap.metatronnest.com/what-to-expect/weekly0.8https://rapharehap.metatronnest.com/why-rapha-physiotherapy-etobicoke/weekly0.8https://rapharehap.metatronnest.com/blog/chronic-pain-treatment-etobicoke/weekly0.8https://rapharehap.metatronnest.com/blog/top-rehab-wellness-etobicoke-hand-massage/weekly0.8https://rapharehap.metatronnest.com/blog/osteopath-near-me-first-visit-rapha-rehab/weekly0.8https://rapharehap.metatronnest.com/blog/strength-training-rehabilitation-rapha-rehab/weekly0.8https://rapharehap.metatronnest.com/blog/biceps-triceps-back-workouts-rapha-rehab/weekly0.8https://rapharehap.metatronnest.com/blog/beginner-workouts-rehab-wellness-rapha-rehab/weekly0.8https://rapharehap.metatronnest.com/blog/recover-strong-post-surgery-rehabilitation-exercises/weekly0.8https://rapharehap.metatronnest.com/blog/benefits-massage-therapy-sports-injuries/weekly0.8https://rapharehap.metatronnest.com/blog/shockwave-therapy-etobicoke-chronic-pain/weekly0.8 \ No newline at end of file +https://rapharehap.metatronnest.com/about-us/weekly0.8https://rapharehap.metatronnest.com/accident/weekly0.8https://rapharehap.metatronnest.com/accident/[slug]/weekly0.8https://rapharehap.metatronnest.com/area-of-injury/weekly0.8https://rapharehap.metatronnest.com/area-of-injury/[slug]/weekly0.8https://rapharehap.metatronnest.com/blog/weekly0.8https://rapharehap.metatronnest.com/blog/[slug]/weekly0.8https://rapharehap.metatronnest.com/caregivers/weekly0.8https://rapharehap.metatronnest.com/contact/weekly0.8https://rapharehap.metatronnest.com/covid-19-updates/weekly0.8https://rapharehap.metatronnest.com/etobicoke-treatment-service/weekly0.8https://rapharehap.metatronnest.com/etobicoke-treatment-service/[slug]/weekly0.8https://rapharehap.metatronnest.com/faq-physiotherapy-etobicoke/weekly0.8https://rapharehap.metatronnest.com/gallery-physiotherapy-etobicoke/weekly0.8https://rapharehap.metatronnest.com/locations/weekly0.8https://rapharehap.metatronnest.com/our-team-physiotherapy-etobicoke/weekly0.8https://rapharehap.metatronnest.com/our-team-physiotherapy-etobicoke/[slug]/weekly0.8https://rapharehap.metatronnest.com/ourapproach-physiotherapy-etobicoke/weekly0.8https://rapharehap.metatronnest.com/weekly1.0https://rapharehap.metatronnest.com/payment-insurance/weekly0.8https://rapharehap.metatronnest.com/rehabilitation/weekly0.8https://rapharehap.metatronnest.com/rehabilitation/[slug]/weekly0.8https://rapharehap.metatronnest.com/shortcodes/weekly0.8https://rapharehap.metatronnest.com/what-to-expect/weekly0.8https://rapharehap.metatronnest.com/why-rapha-physiotherapy-etobicoke/weekly0.8https://rapharehap.metatronnest.com/blog/chronic-pain-treatment-etobicoke/weekly0.8https://rapharehap.metatronnest.com/blog/top-rehab-wellness-etobicoke-hand-massage/weekly0.8https://rapharehap.metatronnest.com/blog/osteopath-near-me-first-visit-rapha-rehab/weekly0.8https://rapharehap.metatronnest.com/blog/strength-training-rehabilitation-rapha-rehab/weekly0.8https://rapharehap.metatronnest.com/blog/biceps-triceps-back-workouts-rapha-rehab/weekly0.8https://rapharehap.metatronnest.com/blog/beginner-workouts-rehab-wellness-rapha-rehab/weekly0.8https://rapharehap.metatronnest.com/blog/recover-strong-post-surgery-rehabilitation-exercises/weekly0.8https://rapharehap.metatronnest.com/blog/benefits-massage-therapy-sports-injuries/weekly0.8https://rapharehap.metatronnest.com/blog/shockwave-therapy-etobicoke-chronic-pain/weekly0.8https://rapharehap.metatronnest.com/etobicoke-treatment-service/physiotherapy-clinic-etobicoke/weekly0.8https://rapharehap.metatronnest.com/etobicoke-treatment-service/sportsinjury-physiotherapy-clinic-etobicoke/weekly0.8https://rapharehap.metatronnest.com/etobicoke-treatment-service/pelvic-floor-physiotherapy-clinic-etobicoke/weekly0.8https://rapharehap.metatronnest.com/etobicoke-treatment-service/massage-therapy-clinic-etobicoke/weekly0.8https://rapharehap.metatronnest.com/etobicoke-treatment-service/chiropractic-clinic-etobicoke/weekly0.8https://rapharehap.metatronnest.com/etobicoke-treatment-service/chiropdist-clinic-etobicoke/weekly0.8https://rapharehap.metatronnest.com/etobicoke-treatment-service/acupuncture-clinic-etobicoke/weekly0.8https://rapharehap.metatronnest.com/etobicoke-treatment-service/osteopathy-clinic-etobicoke/weekly0.8https://rapharehap.metatronnest.com/etobicoke-treatment-service/foot-reflexology-clinic-etobicoke/weekly0.8https://rapharehap.metatronnest.com/etobicoke-treatment-service/custom-knee-braces-clinic-etobicoke/weekly0.8https://rapharehap.metatronnest.com/etobicoke-treatment-service/laser-therapy-electrical-modalities/weekly0.8https://rapharehap.metatronnest.com/etobicoke-treatment-service/naturopathy-clinic-etobicoke/weekly0.8https://rapharehap.metatronnest.com/etobicoke-treatment-service/orthotics-etobicoke/weekly0.8https://rapharehap.metatronnest.com/etobicoke-treatment-service/spinal-decompression-therapy-clinic-etobicoke/weekly0.8https://rapharehap.metatronnest.com/etobicoke-treatment-service/concussion-management-clinic-etobicoke/weekly0.8https://rapharehap.metatronnest.com/etobicoke-treatment-service/chronic-pain-management-clinic-etobicoke/weekly0.8https://rapharehap.metatronnest.com/etobicoke-treatment-service/pre-post-operative-management-etobicoke/weekly0.8https://rapharehap.metatronnest.com/etobicoke-treatment-service/exercisetherapy-clinic-etobicoke/weekly0.8https://rapharehap.metatronnest.com/etobicoke-treatment-service/workplace-injury-management-clinic-etobicoke/weekly0.8https://rapharehap.metatronnest.com/etobicoke-treatment-service/home-care-physiotherapy-clinic-etobicoke/weekly0.8https://rapharehap.metatronnest.com/etobicoke-treatment-service/virtual-care-physiotherapy-clinic-etobicoke/weekly0.8https://rapharehap.metatronnest.com/etobicoke-treatment-service/gait-assessment-etobicoke/weekly0.8https://rapharehap.metatronnest.com/etobicoke-treatment-service/kids-physiotherapy-etobicoke/weekly0.8https://rapharehap.metatronnest.com/etobicoke-treatment-service/surgical-rehab-etobicoke/weekly0.8https://rapharehap.metatronnest.com/etobicoke-treatment-service/fascial-stretch-therapy-etobicoke/weekly0.8https://rapharehap.metatronnest.com/etobicoke-treatment-service/cupping-therapy-etobicoke/weekly0.8https://rapharehap.metatronnest.com/etobicoke-treatment-service/shiatsu-therapy-etobicoke/weekly0.8https://rapharehap.metatronnest.com/etobicoke-treatment-service/deep-tissue-massage-etobicoke/weekly0.8https://rapharehap.metatronnest.com/etobicoke-treatment-service/neuro-fascial-therapy-etobicoke/weekly0.8https://rapharehap.metatronnest.com/etobicoke-treatment-service/cranio-sacral-therapy-etobicoke/weekly0.8https://rapharehap.metatronnest.com/etobicoke-treatment-service/motor-vehicle-accident-rehabilitation-etobicoke/weekly0.8https://rapharehap.metatronnest.com/etobicoke-treatment-service/compression-stockings-etobicoke/weekly0.8https://rapharehap.metatronnest.com/etobicoke-treatment-service/cardiac-rehabilitation-etobicoke/weekly0.8https://rapharehap.metatronnest.com/etobicoke-treatment-service/intramuscular-stimulation-ims-etobicoke/weekly0.8https://rapharehap.metatronnest.com/etobicoke-treatment-service/psychotherapy-etobicoke/weekly0.8https://rapharehap.metatronnest.com/etobicoke-treatment-service/shockwave-therapy-etobicoke/weekly0.8https://rapharehap.metatronnest.com/accident/minor-injury-etobicoke/weekly0.8https://rapharehap.metatronnest.com/accident/catastropic-injury-etobicoke/weekly0.8https://rapharehap.metatronnest.com/accident/slip-and-fall-injury-etobicoke/weekly0.8https://rapharehap.metatronnest.com/accident/concussion-management-etobicoke/weekly0.8https://rapharehap.metatronnest.com/accident/psychotherapy-management-etobicoke/weekly0.8https://rapharehap.metatronnest.com/accident/hydrotherapy-etobicoke/weekly0.8https://rapharehap.metatronnest.com/accident/chronic-pain-management-etobicoke/weekly0.8https://rapharehap.metatronnest.com/area-of-injury/head-injury-physiotherapy-management-etobicoke/weekly0.8https://rapharehap.metatronnest.com/area-of-injury/neck-injury-physiotherapy-management-etobicokeneck-injury-physiotherapy-management-etobicoke/weekly0.8https://rapharehap.metatronnest.com/area-of-injury/shoulder-injury-physiotherapy-management-etobicoke/weekly0.8https://rapharehap.metatronnest.com/area-of-injury/elbow-injury-physiotherapy-management-etobicoke/weekly0.8https://rapharehap.metatronnest.com/area-of-injury/wristhand-injury-physiotherapy-management-etobicoke/weekly0.8https://rapharehap.metatronnest.com/area-of-injury/lowback-injury-physiotherapy-management-etobicoke/weekly0.8https://rapharehap.metatronnest.com/area-of-injury/hip-injury-physiotherapy-management-etobicoke/weekly0.8https://rapharehap.metatronnest.com/area-of-injury/legknee-injury-physiotherapy-management-etobicoke/weekly0.8https://rapharehap.metatronnest.com/area-of-injury/anklefoot-injury-physiotherapy-management-etobicoke/weekly0.8https://rapharehap.metatronnest.com/rehabilitation/spinalcord-rehabilitation-clinic-etobicoke/weekly0.8https://rapharehap.metatronnest.com/rehabilitation/amputee-rehabilitation-clinic-etobicoke/weekly0.8https://rapharehap.metatronnest.com/rehabilitation/fracture-rehabilitation-clinic-etobicoke/weekly0.8https://rapharehap.metatronnest.com/rehabilitation/neurological-rehabilitation-clinic-etobicoke/weekly0.8 \ No newline at end of file diff --git a/scripts/generate-sitemap.cjs b/scripts/generate-sitemap.cjs index c1e111e..4890a95 100644 --- a/scripts/generate-sitemap.cjs +++ b/scripts/generate-sitemap.cjs @@ -3,86 +3,110 @@ const path = require("path"); const { SitemapStream, streamToPromise } = require("sitemap"); const { pathToFileURL } = require("url"); -const hostname = "https://rapharehap.metatronnest.com"; -const appDir = path.join(process.cwd(), "app"); -const outputPath = path.join(process.cwd(), "public", "sitemap.xml"); +const hostname = "https://rapharehap.metatronnest.com"; +const addTrailingSlash = true; // โœ… Set this true if your Next.js uses trailingSlash: true -function getRoutesFromApp(dir = appDir, basePath = "") { - let routes = []; - if (!fs.existsSync(dir)) return routes; +// // ๐Ÿ”ง Utility to format URLs based on config +// const formatUrl = (url) => { +// if (addTrailingSlash && !url.endsWith('/')) return url + '/'; +// if (!addTrailingSlash && url.endsWith('/') && url !== '/') return url.slice(0, -1); +// return url; +// }; +// Add a trailing slash only for โ€œdirectory-likeโ€ URLs +const shouldAddSlash = (url) => { + // keep "/" as is + if (url === '/') return false; + // don't touch file-like URLs (has extension) + if (/\.[a-z0-9]{2,6}(\?.*)?$/i.test(url)) return false; + return true; +}; - const entries = fs.readdirSync(dir, { withFileTypes: true }); - for (const entry of entries) { - if (entry.name.startsWith("_") || entry.name === "api" || entry.name.startsWith(".")) continue; - const fullPath = path.join(dir, entry.name); +const formatUrl = (url) => { + // normalize to leading slash + if (!url.startsWith('/')) url = '/' + url; - if (entry.isDirectory()) { - if (!entry.name.startsWith("[")) { - const hasPage = - fs.existsSync(path.join(fullPath, "page.js")) || - fs.existsSync(path.join(fullPath, "page.jsx")) || - fs.existsSync(path.join(fullPath, "index.js")) || - fs.existsSync(path.join(fullPath, "index.jsx")); - if (hasPage) { - const cleaned = path.join(basePath, entry.name).replace(/\\/g, "/"); - routes.push(`/${cleaned}/`); - } - } - routes = routes.concat(getRoutesFromApp(fullPath, path.join(basePath, entry.name))); - } else if (entry.isFile()) { - if (["page.js", "page.jsx", "index.js", "index.jsx"].includes(entry.name)) { - const cleaned = basePath.replace(/\\/g, "/"); - const route = "/" + (cleaned ? `${cleaned}/` : ""); - routes.push(route); - } - } + if (addTrailingSlash && shouldAddSlash(url) && !url.endsWith('/')) { + return url + '/'; } + if (!addTrailingSlash && url.endsWith('/') && url !== '/') { + return url.slice(0, -1); + } + return url; +}; - return [...new Set(routes.map(r => r.replace(/\/{2,}/g, "/")))]; -} +// โœ… Static pages +const staticLinks = [ + { url: '/', changefreq: 'daily', priority: 1.0 }, + { url: '/caregivers/', changefreq: 'weekly', priority: 0.7 }, + { url: '/about-us/', changefreq: 'weekly', priority: 0.7 }, + { url: '/careers/', changefreq: 'weekly', priority: 0.7 }, + { url: '/portfolio/', changefreq: 'weekly', priority: 0.7 }, + { url: '/blog/', changefreq: 'weekly', priority: 0.7 }, + { url: '/contact/', changefreq: 'monthly', priority: 0.5 }, + { url: '/faq/', changefreq: 'monthly', priority: 0.5 }, + { url: '/service/website-development-company/', changefreq: 'weekly', priority: 0.6 }, + { url: '/service/mobile-application-development/', changefreq: 'weekly', priority: 0.6 }, + { url: '/service/graphic-designing-company/', changefreq: 'weekly', priority: 0.6 }, + { url: '/service/ui-ux-designing/', changefreq: 'weekly', priority: 0.6 }, + { url: '/service/search-engine-optimization-seo-content-writing/', changefreq: 'weekly', priority: 0.6 }, + { url: '/service/digital-marketing-agency-in-canada/', changefreq: 'weekly', priority: 0.6 }, + { url: '/service/app-development-waterloo/', changefreq: 'weekly', priority: 0.6 }, + { url: '/service/kitchener-waterloo-website-design-services/', changefreq: 'weekly', priority: 0.6 }, + { url: '/service/professional-website-designers-in-waterloo/', changefreq: 'weekly', priority: 0.6 }, + { url: '/service/waterloo-seo-services/', changefreq: 'weekly', priority: 0.6 }, + { url: '/service/web-design-toronto-custom-website-creation-by-metatroncube-software-solutions/', changefreq: 'weekly', priority: 0.6 }, + { url: '/service/web-page-design-in-waterloo/', changefreq: 'weekly', priority: 0.6 }, +]; -async function loadESModule(relativePath) { - const fullPath = path.join(process.cwd(), relativePath); - if (!fs.existsSync(fullPath)) return null; - const mod = await import(pathToFileURL(fullPath).href); - return mod.default ?? mod.Blogs ?? []; -} +// โœ… Dynamic blog posts +const blogPosts = [ + { slug: '5-tips-to-create-viral-content-that-drives-engagement/' }, + { slug: 'instagram-vs-facebook-choosing-the-right-platform-for-your-business/' }, + { slug: 'how-local-seo-can-drive-more-foot-traffic-to-your-business/' }, + { slug: 'on-page-vs-off-page-seo-what-every-business-owner-needs-to-know/' }, + { slug: 'how-to-create-a-winning-digital-marketing-strategy-for-your-business/' }, + { slug: 'white-hat-vs-black-hat-seo-an-in-depth-link-building-guide/' }, + { slug: 'how-to-boost-your-small-business-with-effective-digital-marketing-strategies/' }, + { slug: 'the-importance-of-local-seo-for-real-estate-agents/' }, + { slug: 'how-to-optimize-your-website-for-voice-search/' }, + { slug: 'how-ai-is-revolutionizing-web-development-and-seo/' }, + { slug: 'top-digital-marketing-agency-in-canada-metatroncube-software-solutions/' }, + { slug: 'best-digital-marketing-company-in-canada-metatroncube-solutions/' }, + { slug: 'web-designers-for-small-business/' }, + { slug: 'mobile-commerce-2024-web-app-development-evolution/' }, +]; + +// Convert blog slugs to sitemap entries +const blogLinks = blogPosts.map(post => ({ + url: `/${post.slug}`, + changefreq: 'weekly', + priority: 0.6 +})); + +const allLinks = [...staticLinks, ...blogLinks].map(link => ({ + ...link, + url: formatUrl(link.url), +})); async function generateSitemap() { try { - - const staticRoutes = getRoutesFromApp(); - const staticLinks = staticRoutes.map(route => ({ - url: route, - changefreq: "weekly", - priority: route === "/" ? 1.0 : 0.8, - })); + const sitemap = new SitemapStream({ hostname: hostname }); + const writeStream = fs.createWriteStream(path.resolve(__dirname, '../out/sitemap.xml')); - const Blogs = await loadESModule("utils/Blog.utils.js"); - const blogLinks = (Blogs || []).map(post => ({ - url: `/blog/${post.slug}/`, - changefreq: "weekly", - priority: 0.8, - })); - - const allLinks = [...staticLinks, ...blogLinks]; - - const sitemap = new SitemapStream({ hostname }); - const writeStream = fs.createWriteStream(outputPath); sitemap.pipe(writeStream); + console.log('๐Ÿ“ฆ Writing URLs to sitemap:'); allLinks.forEach(link => { + console.log(' -', hostname + link.url); sitemap.write(link); - console.log("โœ… writing:", link.url); }); sitemap.end(); await streamToPromise(sitemap); - console.log(`๐ŸŽ‰ sitemap.xml generated at ${outputPath} (${allLinks.length} URLs)`); - } catch (err) { - console.error("โŒ Failed to generate sitemap:", err); - process.exit(1); + console.log('โœ… sitemap.xml created successfully!'); + } catch (error) { + console.error('โŒ Error creating sitemap.xml:', error); } }