This documentation is also published as Markdown for efficient machine reading: the whole site is indexed at /llms.txt, and every page has a clean Markdown copy under /_llms/. These are generated from the same source and cost far fewer tokens to read than this rendered HTML.

Skip to main content Skip to navigation

SitemapBuilder Pennington.Feeds

Builds sitemap entries from a set of SitemapCandidate rows.

Properties

CanonicalBase UrlPath
Canonical site base URL used when resolving absolute entry URLs.

Constructors

SitemapBuilder

#
public SitemapBuilder(UrlPath canonicalBase, TimeProvider clock = null)

Initializes the builder with the canonical site base URL used to produce absolute entry URLs and the wall clock used to filter out future-dated (scheduled) entries.

Parameters

canonicalBase UrlPath
clock TimeProvider

Methods

Build

#
public ImmutableList<SitemapEntry> Build(IReadOnlyList<SitemapCandidate> candidates)

Build sitemap entries from candidate rows. Excludes drafts and future-dated (scheduled) entries.

Parameters

candidates IReadOnlyList<SitemapCandidate>

Returns

ImmutableList<SitemapEntry>

Publishable

#
public IReadOnlyList<SitemapCandidate> Publishable(IReadOnlyList<SitemapCandidate> candidates)

Filters candidates down to the rows that actually belong in the sitemap — drafts, future-dated (scheduled), and redirect rows removed. Use this when deriving sitemap-adjacent data (e.g. hreflang alternates) so it stays in lockstep with Build.

Parameters

candidates IReadOnlyList<SitemapCandidate>

Returns

IReadOnlyList<SitemapCandidate>

Pennington.Feeds.SitemapBuilder

namespace Pennington.Feeds;

/// Builds sitemap entries from a set of SitemapCandidate rows.
public class SitemapBuilder
{
    /// Build sitemap entries from candidate rows. Excludes drafts and future-dated (scheduled) entries.
    
public ImmutableList<SitemapEntry> Build(IReadOnlyList<SitemapCandidate> candidates)
; /// Canonical site base URL used when resolving absolute entry URLs.
public UrlPath CanonicalBase { get; }
/// Filters candidates down to the rows that actually belong in the sitemap — drafts, future-dated (scheduled), and redirect rows removed. Use this when deriving sitemap-adjacent data (e.g. hreflang alternates) so it stays in lockstep with Build.
public IReadOnlyList<SitemapCandidate> Publishable(IReadOnlyList<SitemapCandidate> candidates)
; /// Initializes the builder with the canonical site base URL used to produce absolute entry URLs and the wall clock used to filter out future-dated (scheduled) entries.
public SitemapBuilder(UrlPath canonicalBase, TimeProvider clock = null)
; }