← @mortar-kit/core

SitemapOptionsinterface

import { SitemapOptions } from '@mortar-kit/core'

interface SitemapOptions

Options for sitemap.

Properties

origin: string

The site's public origin, e.g. https://example.com.

include?: (collection: AnyCollection, doc: { id: string; slug: string; fields: Record<string, unknown> }) => boolean

Leave a document out (e.g. drafts).

extra?: readonly string[]

Paths to list besides the documents', e.g. ['/posts'].

lastmod?: string | ((collection: AnyCollection, doc: { id: string; slug: string; fields: Record<string, unknown> }) => string | Date | null | undefined)

When each document last changed, as its <lastmod>: the name of a field holding a date (fields.date's YYYY-MM-DD, or a full ISO time), or a function returning one (a string or a Date). Documents without one get no <lastmod>.