194 lines
5.1 KiB
TypeScript
194 lines
5.1 KiB
TypeScript
import { MetadataRoute } from "next"
|
|
import { businessConfig } from "@/lib/seo-config"
|
|
|
|
// Required for static export
|
|
export const dynamic = "force-static"
|
|
import { getAllLocationSlugs } from "@/lib/location-data"
|
|
import { buildAbsoluteUrl } from "@/lib/seo-registry"
|
|
|
|
export default function sitemap(): MetadataRoute.Sitemap {
|
|
const currentDate = new Date().toISOString()
|
|
|
|
// Get all location pages
|
|
const locationSlugs = getAllLocationSlugs()
|
|
const locationPages = locationSlugs.map((slug) => ({
|
|
url: buildAbsoluteUrl(`/vending-machines-${slug}`),
|
|
lastModified: currentDate,
|
|
changeFrequency: "monthly" as const,
|
|
priority: 0.9,
|
|
}))
|
|
|
|
// Static pages with priorities and change frequencies
|
|
const staticPages = [
|
|
{
|
|
url: businessConfig.website,
|
|
lastModified: currentDate,
|
|
changeFrequency: "weekly" as const,
|
|
priority: 1.0,
|
|
},
|
|
{
|
|
url: buildAbsoluteUrl("/contact-us"),
|
|
lastModified: currentDate,
|
|
changeFrequency: "monthly" as const,
|
|
priority: 0.9,
|
|
},
|
|
{
|
|
url: buildAbsoluteUrl("/about-us"),
|
|
lastModified: currentDate,
|
|
changeFrequency: "monthly" as const,
|
|
priority: 0.8,
|
|
},
|
|
{
|
|
url: buildAbsoluteUrl("/about/faqs"),
|
|
lastModified: currentDate,
|
|
changeFrequency: "monthly" as const,
|
|
priority: 0.7,
|
|
},
|
|
// Services
|
|
{
|
|
url: buildAbsoluteUrl("/services"),
|
|
lastModified: currentDate,
|
|
changeFrequency: "monthly" as const,
|
|
priority: 0.9,
|
|
},
|
|
{
|
|
url: buildAbsoluteUrl("/services/repairs"),
|
|
lastModified: currentDate,
|
|
changeFrequency: "monthly" as const,
|
|
priority: 0.8,
|
|
},
|
|
{
|
|
url: buildAbsoluteUrl("/services/moving"),
|
|
lastModified: currentDate,
|
|
changeFrequency: "monthly" as const,
|
|
priority: 0.8,
|
|
},
|
|
{
|
|
url: buildAbsoluteUrl("/services/parts"),
|
|
lastModified: currentDate,
|
|
changeFrequency: "monthly" as const,
|
|
priority: 0.8,
|
|
},
|
|
// Vending Machines
|
|
{
|
|
url: buildAbsoluteUrl("/vending-machines"),
|
|
lastModified: currentDate,
|
|
changeFrequency: "monthly" as const,
|
|
priority: 0.9,
|
|
},
|
|
{
|
|
url: buildAbsoluteUrl("/vending-machines/machines-we-use"),
|
|
lastModified: currentDate,
|
|
changeFrequency: "monthly" as const,
|
|
priority: 0.8,
|
|
},
|
|
{
|
|
url: buildAbsoluteUrl("/vending-machines/machines-for-sale"),
|
|
lastModified: currentDate,
|
|
changeFrequency: "monthly" as const,
|
|
priority: 0.8,
|
|
},
|
|
// Who We Serve
|
|
{
|
|
url: buildAbsoluteUrl("/warehouses"),
|
|
lastModified: currentDate,
|
|
changeFrequency: "monthly" as const,
|
|
priority: 0.7,
|
|
},
|
|
{
|
|
url: buildAbsoluteUrl("/auto-repair"),
|
|
lastModified: currentDate,
|
|
changeFrequency: "monthly" as const,
|
|
priority: 0.7,
|
|
},
|
|
{
|
|
url: buildAbsoluteUrl("/gyms"),
|
|
lastModified: currentDate,
|
|
changeFrequency: "monthly" as const,
|
|
priority: 0.7,
|
|
},
|
|
{
|
|
url: buildAbsoluteUrl("/community-centers"),
|
|
lastModified: currentDate,
|
|
changeFrequency: "monthly" as const,
|
|
priority: 0.7,
|
|
},
|
|
{
|
|
url: buildAbsoluteUrl("/dance-studios"),
|
|
lastModified: currentDate,
|
|
changeFrequency: "monthly" as const,
|
|
priority: 0.7,
|
|
},
|
|
{
|
|
url: buildAbsoluteUrl("/car-washes"),
|
|
lastModified: currentDate,
|
|
changeFrequency: "monthly" as const,
|
|
priority: 0.7,
|
|
},
|
|
// Food and Beverage
|
|
{
|
|
url: buildAbsoluteUrl("/food-and-beverage/healthy-options"),
|
|
lastModified: currentDate,
|
|
changeFrequency: "monthly" as const,
|
|
priority: 0.7,
|
|
},
|
|
{
|
|
url: buildAbsoluteUrl("/food-and-beverage/traditional-options"),
|
|
lastModified: currentDate,
|
|
changeFrequency: "monthly" as const,
|
|
priority: 0.7,
|
|
},
|
|
{
|
|
url: buildAbsoluteUrl("/food-and-beverage/suppliers"),
|
|
lastModified: currentDate,
|
|
changeFrequency: "monthly" as const,
|
|
priority: 0.7,
|
|
},
|
|
// Service Areas Page
|
|
{
|
|
url: buildAbsoluteUrl("/service-areas"),
|
|
lastModified: currentDate,
|
|
changeFrequency: "monthly" as const,
|
|
priority: 0.9,
|
|
},
|
|
// Manuals Page
|
|
{
|
|
url: buildAbsoluteUrl("/manuals"),
|
|
lastModified: currentDate,
|
|
changeFrequency: "weekly" as const,
|
|
priority: 0.8,
|
|
},
|
|
{
|
|
url: buildAbsoluteUrl("/reviews"),
|
|
lastModified: currentDate,
|
|
changeFrequency: "monthly" as const,
|
|
priority: 0.7,
|
|
},
|
|
{
|
|
url: buildAbsoluteUrl("/blog"),
|
|
lastModified: currentDate,
|
|
changeFrequency: "weekly" as const,
|
|
priority: 0.7,
|
|
},
|
|
{
|
|
url: buildAbsoluteUrl("/privacy-policy"),
|
|
lastModified: currentDate,
|
|
changeFrequency: "yearly" as const,
|
|
priority: 0.3,
|
|
},
|
|
{
|
|
url: buildAbsoluteUrl("/terms-and-conditions"),
|
|
lastModified: currentDate,
|
|
changeFrequency: "yearly" as const,
|
|
priority: 0.3,
|
|
},
|
|
]
|
|
|
|
// Combine all pages, removing duplicates by URL
|
|
const allPages = [...staticPages, ...locationPages]
|
|
const uniquePages = allPages.filter(
|
|
(page, index, self) => index === self.findIndex((p) => p.url === page.url)
|
|
)
|
|
|
|
return uniquePages
|
|
}
|