SitemapBuilder Pennington.Feeds
Builds sitemap entries from a set of SitemapCandidate rows.
Properties
CanonicalBaseUrlPath- 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
canonicalBaseUrlPathclockTimeProvider
Methods
Build
#public ImmutableList<SitemapEntry> Build(IReadOnlyList<SitemapCandidate> candidates)
Build sitemap entries from candidate rows. Excludes drafts and future-dated (scheduled) entries.
Parameters
candidatesIReadOnlyList<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
candidatesIReadOnlyList<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)
;
}