NavigationBuilder Pennington.Navigation
Builds hierarchical navigation trees and related navigation metadata from flat TOC entries.
Methods
BuildNavigationInfo
#public NavigationInfo BuildNavigationInfo(
IReadOnlyList<ContentTocItem> items,
ContentRoute currentRoute,
string? locale = null);Build NavigationInfo for a specific route within the tree.
Parameters
itemsIReadOnlyList<ContentTocItem>currentRouteContentRoutelocalestring? (optional)
Returns
NavigationInfoBuildTree
#public ImmutableList<NavigationTreeItem> BuildTree(
IReadOnlyList<ContentTocItem> items,
ContentRoute? currentRoute = null,
string? locale = null);Build a navigation tree from flat TOC items. When locale is specified, filters to that locale and strips the locale prefix from hierarchy parts.
Parameters
itemsIReadOnlyList<ContentTocItem>currentRouteContentRoute? (optional)localestring? (optional)
Returns
ImmutableList<NavigationTreeItem>Pennington.Navigation.NavigationBuilder
namespace Pennington.Navigation;
/// Builds hierarchical navigation trees and related navigation metadata from flat TOC entries.
public class NavigationBuilder
{
/// Build NavigationInfo for a specific route within the tree.
public NavigationInfo BuildNavigationInfo(
IReadOnlyList<ContentTocItem> items,
ContentRoute currentRoute,
string? locale = null);
/// Build a navigation tree from flat TOC items. When locale is specified, filters to that locale and strips the locale prefix from hierarchy parts.
public ImmutableList<NavigationTreeItem> BuildTree(
IReadOnlyList<ContentTocItem> items,
ContentRoute? currentRoute = null,
string? locale = null);
}