BlogSiteContentService
Pennington.BlogSite.Services
Emits the paginated archive routes (/archive/page/{n}) the parameterized @page template hides from automatic discovery, and projects the site-identity record for the template-owned home page (so / participates in social-card generation). Post counts come from the shared BlogPostQuery (cached records, no disk re-read); browse-by-tag is a registered taxonomy; the canonical /archive route comes from RazorPageContentService.
Properties
DefaultSectionLabelstring- Default section label applied to discovered items that do not supply one via front matter.
SearchPriorityint- Relative priority for ordering results in the search index (higher values rank first).
Constructors
BlogSiteContentService
#public BlogSiteContentService(BlogSiteOptions options, IServiceProvider services)
Creates the service. The provider resolves BlogPostQuery on demand to avoid a construction cycle through the content-record registry.
Parameters
optionsBlogSiteOptionsservicesIServiceProvider
Methods
DiscoverAsync
#public IAsyncEnumerable<DiscoveredItem> DiscoverAsync()
Discover all content items this service is responsible for.
Returns
IAsyncEnumerable<DiscoveredItem>GetContentTocEntriesAsync
#public Task<ImmutableList<ContentTocItem>> GetContentTocEntriesAsync()
Navigation entries for table of contents.
Returns
Task<ImmutableList<ContentTocItem>>GetContentToCopyAsync
#public Task<ImmutableList<ContentToCopy>> GetContentToCopyAsync()
Static files to copy to output (images, downloads, etc.)
Returns
Task<ImmutableList<ContentToCopy>>GetCrossReferencesAsync
#public Task<ImmutableList<CrossReference>> GetCrossReferencesAsync()
Cross-references for xref resolution.
Returns
Task<ImmutableList<CrossReference>>GetRecordsAsync
#public IAsyncEnumerable<ContentRecord> GetRecordsAsync()
Projects this service's routable content as ContentRecords — the discovery seam consumed by taxonomy, search faceting, and structured-data emission.
Default: bridges from DiscoverAsync, yielding one record per discovered item that carries Metadata and is neither a RedirectSource (transport, not content) nor an LlmsOnlySource (no human-facing URL). A service that attaches typed metadata to its discovered items — as MarkdownContentService does — therefore participates with no extra code. Override only to project records that do not flow through DiscoverAsync, or to suppress records entirely.
A service that emits routable content from DiscoverAsync but leaves Metadata unset projects no records, and so silently sits out of taxonomy, search faceting, and structured data. Set the metadata (or override this) to opt in.
Returns
IAsyncEnumerable<ContentRecord>Pennington.BlogSite.Services.BlogSiteContentService
namespace Pennington.BlogSite.Services;
/// Emits the paginated archive routes (/archive/page/{n}) the parameterized @page template hides from automatic discovery, and projects the site-identity record for the template-owned home page (so / participates in social-card generation). Post counts come from the shared BlogPostQuery (cached records, no disk re-read); browse-by-tag is a registered taxonomy; the canonical /archive route comes from RazorPageContentService.
public class BlogSiteContentService
{
/// Creates the service. The provider resolves BlogPostQuery on demand to avoid a construction cycle through the content-record registry.
public BlogSiteContentService(BlogSiteOptions options, IServiceProvider services)
;
/// Default section label applied to discovered items that do not supply one via front matter.
public string DefaultSectionLabel { get; }
/// Discover all content items this service is responsible for.
public IAsyncEnumerable<DiscoveredItem> DiscoverAsync()
;
/// Navigation entries for table of contents.
public Task<ImmutableList<ContentTocItem>> GetContentTocEntriesAsync()
;
/// Static files to copy to output (images, downloads, etc.)
public Task<ImmutableList<ContentToCopy>> GetContentToCopyAsync()
;
/// Cross-references for xref resolution.
public Task<ImmutableList<CrossReference>> GetCrossReferencesAsync()
;
/// Projects this service's routable content as ContentRecords — the discovery seam consumed by taxonomy, search faceting, and structured-data emission. Default: bridges from DiscoverAsync, yielding one record per discovered item that carries Metadata and is neither a RedirectSource (transport, not content) nor an LlmsOnlySource (no human-facing URL). A service that attaches typed metadata to its discovered items — as MarkdownContentService does — therefore participates with no extra code. Override only to project records that do not flow through DiscoverAsync, or to suppress records entirely.A service that emits routable content from DiscoverAsync but leaves Metadata unset projects no records, and so silently sits out of taxonomy, search faceting, and structured data. Set the metadata (or override this) to opt in.
public IAsyncEnumerable<ContentRecord> GetRecordsAsync()
;
/// Relative priority for ordering results in the search index (higher values rank first).
public int SearchPriority { get; }
}