SocialCardContentService
Pennington.SocialCards
Discovers one social-card image route per content page so the static build bakes a card for every page: the crawler HTTP-fetches each discovered route and the sibling MapSocialCards endpoint renders it on demand. Mirrors TaxonomyContentService — it emits EndpointSource routes served by an endpoint and projects no records of its own.
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
SocialCardContentService
#public SocialCardContentService(IServiceProvider serviceProvider, SocialCardOptions options)
Creates the service. Sibling content services are resolved on demand to avoid a DI cycle.
Parameters
serviceProviderIServiceProvideroptionsSocialCardOptions
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.SocialCards.SocialCardContentService
namespace Pennington.SocialCards;
/// Discovers one social-card image route per content page so the static build bakes a card for every page: the crawler HTTP-fetches each discovered route and the sibling MapSocialCards endpoint renders it on demand. Mirrors TaxonomyContentService — it emits EndpointSource routes served by an endpoint and projects no records of its own.
public class SocialCardContentService
{
/// 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; }
/// Creates the service. Sibling content services are resolved on demand to avoid a DI cycle.
public SocialCardContentService(IServiceProvider serviceProvider, SocialCardOptions options)
;
}