import type { MetadataRoute } from "next"; import { getLocalizedPath, siteConfig } from "@/lib/site"; import { isComingSoonMode } from "@/lib/site"; import type { Locale } from "@/lib/i18n"; const allPages = ["", "/about", "/contact"] as const; const allLocales = ["ar", "en"] as const; export default function sitemap(): MetadataRoute.Sitemap { const lastModified = new Date(); const comingSoon = isComingSoonMode(); const pages: readonly (typeof allPages)[number][] = comingSoon ? [] : allPages; const locales: readonly Locale[] = comingSoon ? [] : allLocales; return [ { url: siteConfig.siteUrl, lastModified, changeFrequency: "weekly", priority: 0.8, }, ...pages.flatMap((page) => locales.map((locale) => ({ url: `${siteConfig.siteUrl}${getLocalizedPath(page, locale)}`, lastModified, changeFrequency: "weekly" as const, priority: page === "" ? 1 : 0.7, })), ), ]; }