NavigationBuilder
Pennington.Navigation
Builds hierarchical navigation trees and related navigation metadata from flat TOC entries.
Constructors
NavigationBuilder
#public NavigationBuilder(FolderMetadataRegistry folderMetadata)
Creates a navigation builder that consults folderMetadata for folder-level title and order overrides discovered from _meta.yml sidecars.
Parameters
folderMetadataFolderMetadataRegistry
Methods
BuildNavigationInfoAsync
#public Task<NavigationInfo> BuildNavigationInfoAsync(IReadOnlyList<ContentTocItem> items, UrlPath currentPath, string locale = null)
Build NavigationInfo for the page at currentPath within the tree. See BuildTreeAsync for snapshot-resolution semantics.
Parameters
itemsIReadOnlyList<ContentTocItem>currentPathUrlPathlocalestring
Returns
Task<NavigationInfo>BuildTreeAsync
#public Task<ImmutableList<NavigationTreeItem>> BuildTreeAsync(IReadOnlyList<ContentTocItem> items, UrlPath? currentPath = default, string locale = null)
Build a navigation tree from flat TOC items. Resolves the folder-metadata snapshot once via GetSnapshotAsync when configured; recursion stays sync once the snapshot is in hand. When locale is specified, filters to that locale and strips the locale prefix from hierarchy parts. When currentPath is specified, stamps IsSelected/IsExpanded along the path to that page.
Parameters
itemsIReadOnlyList<ContentTocItem>currentPathUrlPath?localestring
Returns
Task<ImmutableList<NavigationTreeItem>>OnFileChanged
#public FileWatchResponse OnFileChanged(FileChangeNotification change)
Called on the file-watcher thread for every watched change. Must be quick and thread-safe.
Parameters
changeFileChangeNotification
Returns
FileWatchResponsePennington.Navigation.NavigationBuilder
namespace Pennington.Navigation;
/// Builds hierarchical navigation trees and related navigation metadata from flat TOC entries.
public class NavigationBuilder
{
/// Build NavigationInfo for the page at currentPath within the tree. See BuildTreeAsync for snapshot-resolution semantics.
public Task<NavigationInfo> BuildNavigationInfoAsync(IReadOnlyList<ContentTocItem> items, UrlPath currentPath, string locale = null)
;
/// Build a navigation tree from flat TOC items. Resolves the folder-metadata snapshot once via GetSnapshotAsync when configured; recursion stays sync once the snapshot is in hand. When locale is specified, filters to that locale and strips the locale prefix from hierarchy parts. When currentPath is specified, stamps IsSelected/IsExpanded along the path to that page.
public Task<ImmutableList<NavigationTreeItem>> BuildTreeAsync(IReadOnlyList<ContentTocItem> items, UrlPath? currentPath = default, string locale = null)
;
/// Creates a navigation builder that consults folderMetadata for folder-level title and order overrides discovered from _meta.yml sidecars.
public NavigationBuilder(FolderMetadataRegistry folderMetadata)
;
/// Called on the file-watcher thread for every watched change. Must be quick and thread-safe.
public FileWatchResponse OnFileChanged(FileChangeNotification change)
;
}