export const SITE_URL = process.env.NEXT_PUBLIC_SITE_URL ?? "https://meezi.ir";

/**
 * Self-referencing canonical + complete fa/en/x-default hreflang cluster for a
 * page. Pass the path WITHOUT the locale prefix, e.g. "/contact" (or "" for the
 * locale home). Use on every page's `alternates` so inner pages don't inherit
 * the homepage canonical (which silently de-dupes them in Search Console).
 */
export function pageAlternates(locale: string, path = "") {
  return {
    canonical: `${SITE_URL}/${locale}${path}`,
    languages: {
      fa: `${SITE_URL}/fa${path}`,
      en: `${SITE_URL}/en${path}`,
      "x-default": `${SITE_URL}/fa${path}`,
    },
  };
}
