← back to Trademarks Copyright

src/app/sitemap.ts

25 lines

import type { MetadataRoute } from "next";

const BASE = process.env.APP_BASE_URL || "http://localhost:9770";

export default function sitemap(): MetadataRoute.Sitemap {
  const now = new Date();
  const paths: { path: string; priority: number; changeFrequency: "daily" | "weekly" | "monthly" }[] = [
    { path: "/drops",          priority: 1.0, changeFrequency: "daily" },
    { path: "/drops/archive",  priority: 0.9, changeFrequency: "daily" },
    { path: "/pricing",        priority: 0.9, changeFrequency: "monthly" },
    { path: "/faq",            priority: 0.7, changeFrequency: "monthly" },
    { path: "/about",          priority: 0.6, changeFrequency: "monthly" },
    { path: "/changelog",      priority: 0.4, changeFrequency: "weekly" },
    { path: "/legal/terms",    priority: 0.3, changeFrequency: "monthly" },
    { path: "/legal/privacy",  priority: 0.3, changeFrequency: "monthly" },
    { path: "/legal/refund",   priority: 0.3, changeFrequency: "monthly" },
  ];
  return paths.map((p) => ({
    url: `${BASE}${p.path}`,
    lastModified: now,
    changeFrequency: p.changeFrequency,
    priority: p.priority,
  }));
}