﻿// Detect the current domain
const baseUrl = window.location.origin; // Includes protocol (http/https) and hostname

// Generate the current timestamp in ISO format
const currentTimestamp = new Date().toISOString(); // Example: "2025-04-22T15:32:00+00:00"

// Dynamically generate sitemap content with the current timestamp
const sitemapContent = `
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
  <url>
    <loc>${baseUrl}/</loc>
    <lastmod>${currentTimestamp}</lastmod>
    <priority>1.00</priority>
  </url>
  <url>
    <loc>${baseUrl}/pages/geometry-bread/</loc>
    <lastmod>${currentTimestamp}</lastmod>
    <priority>0.80</priority>
  </url>
  <url>
    <loc>${baseUrl}/pages/fractions-baking/</loc>
    <lastmod>${currentTimestamp}</lastmod>
    <priority>0.80</priority>
  </url>
  <url>
    <loc>${baseUrl}/pages/yeast-growth/</loc>
    <lastmod>${currentTimestamp}</lastmod>
    <priority>0.80</priority>
  </url>
  <url>
    <loc>${baseUrl}/pages/heat-transfer/</loc>
    <lastmod>${currentTimestamp}</lastmod>
    <priority>0.80</priority>
  </url>
</urlset>
`;
// Log the dynamically created sitemap
console.log(sitemapContent);