netlify/functions/product-page.jsSSR product pages with clean URLs:
/marketplace/product/{slug}/ instead of ?id=xxxscripts/generate-sitemap.jsGenerates sitemaps from Supabase:
sitemap-products.xml - All active products with URLssitemap-locations.xml - All shops (splits if >45k)sitemap.xml - Index pointing to all sitemaps_redirectsUpdated with new route:
/marketplace/product/:slug/ /.netlify/functions/product-page 200!
# Copy the new files to your project
cp /path/to/product-page.js ~/Desktop/joe-marketing-site/netlify/functions/
cp /path/to/generate-sitemap.js ~/Desktop/joe-marketing-site/scripts/
cp /path/to/_redirects ~/Desktop/joe-marketing-site/
In netlify/functions/location-page.js (around line 153):
Change:
<a href="/marketplace/product/?id=${p.id}" class="product-card">
To:
<a href="/marketplace/product/${p.slug || p.id}/" class="product-card">
In marketplace/index.html (wherever product cards link):
Change any:
href="/marketplace/product/?id=${p.id}"
To:
href="/marketplace/product/${p.slug || p.id}/"
cd ~/Desktop/joe-marketing-site
# Install dependencies if needed
npm install @supabase/supabase-js
# Generate sitemaps
SUPABASE_SERVICE_KEY=your-key node scripts/generate-sitemap.js
git add .
git commit -m "Add SSR product pages and sitemaps for SEO"
git push
Marketplace:
├── /marketplace/ → Product grid page
└── /marketplace/product/{slug}/ → Individual product (SSR)
Sitemaps:
├── /sitemap.xml → Index
├── /sitemap-static.xml → Static pages
├── /sitemap-products.xml → All products
└── /sitemap-locations.xml → All shops
After deploy, test these URLs:
https://joe.coffee/marketplace/product/some-product-slug/ - Should render with meta tagshttps://joe.coffee/sitemap.xml - Should list all sitemapshttps://joe.coffee/sitemap-products.xml - Should list all products