import type { BasePayload } from 'payload'; import type { I18nConfig } from '../i18n/index.js'; import type { ContentOption } from '../content/index.js'; /** * One sitemap entry, shaped for Next's `app/sitemap.ts`. * * `alternates.languages` is the important part for a multilingual site: Next * renders it as `` per URL, which is * exactly what Google uses to connect language versions. A sitemap without it * is the common, weaker kind. */ export type SitemapEntry = { url: string; lastModified?: string | Date; changeFrequency?: 'always' | 'hourly' | 'daily' | 'weekly' | 'monthly' | 'yearly' | 'never'; priority?: number; alternates?: { languages: Record; }; }; type BuildSitemapArgs = { payload: BasePayload; config: I18nConfig; /** Absolute origin, e.g. 'https://example.com'. Required for valid sitemap URLs. */ baseUrl: string; /** Pages collection slug. Defaults to 'pages'. */ pagesSlug?: string; /** Archive-backed collections, same value as the plugin option. */ content?: ContentOption; /** SiteSettings global slug. Defaults to 'site-settings'. */ settingsSlug?: string; /** * Slug of the page that is the site root (collapses to /{locale}). * Read from System Pages when omitted. */ homeSlug?: string; changeFrequency?: SitemapEntry['changeFrequency']; }; /** * Collects every public URL — pages and archive entries — as sitemap entries * with per-URL hreflang and lastmod. * * Reuses the same path/hreflang builders as page metadata, so the sitemap can't * drift from what the pages actually render (a classic source of sitemap bugs: * a URL listed one way and served another). Drafts and noindex documents are * omitted. * * ```ts * // app/sitemap.ts * export default async function sitemap() { * return buildSitemapEntries({ * payload: await getPayload({ config }), * config: i18nConfig, * baseUrl: process.env.NEXT_PUBLIC_SERVER_URL!, * content: contentConfig, * }) * } * ``` */ export declare function buildSitemapEntries({ payload, config, baseUrl, pagesSlug, content, settingsSlug, homeSlug, changeFrequency, }: BuildSitemapArgs): Promise; export {};