ContentRootAssetService
Pennington.Content
Surfaces every servable file under the content root as a ContentToCopy, so the static build mirrors the whole-content-root static mount that UsePennington serves at runtime.
Files placed in the content root but outside any markdown source's ContentPath (the documented home for shared, absolute-URL assets) are served live but were never copied by the build. Routing them through GetContentToCopyAsync closes that gap on one code path: the build copy and both link auditors already consume CollectContentToCopyAsync, so dev and build cannot diverge.
Carries no routes, navigation, or search entries — it is an asset-copy source only. Register it after the markdown sources so their (prefix-aware) outputs win the output-path dedup in the build.
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
ContentRootAssetService
#public ContentRootAssetService(string contentRootPath, IFileSystem fileSystem, IContentTypeProvider contentTypeProvider = null)
Creates the service over contentRootPath; the content-type gate defaults to ASP.NET's standard extension map.
Parameters
contentRootPathstringfileSystemIFileSystemcontentTypeProviderIContentTypeProvider
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>>Pennington.Content.ContentRootAssetService
namespace Pennington.Content;
/// Surfaces every servable file under the content root as a ContentToCopy, so the static build mirrors the whole-content-root static mount that UsePennington serves at runtime. Files placed in the content root but outside any markdown source's ContentPath (the documented home for shared, absolute-URL assets) are served live but were never copied by the build. Routing them through GetContentToCopyAsync closes that gap on one code path: the build copy and both link auditors already consume CollectContentToCopyAsync, so dev and build cannot diverge.Carries no routes, navigation, or search entries — it is an asset-copy source only. Register it after the markdown sources so their (prefix-aware) outputs win the output-path dedup in the build.
public class ContentRootAssetService
{
/// Creates the service over contentRootPath; the content-type gate defaults to ASP.NET's standard extension map.
public ContentRootAssetService(string contentRootPath, IFileSystem fileSystem, IContentTypeProvider contentTypeProvider = null)
;
/// 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()
;
/// Relative priority for ordering results in the search index (higher values rank first).
public int SearchPriority { get; }
}