private static OrganizationInfo GetContainerOrganizationInfo(this Item item) { var organizationInfo = new OrganizationInfo(); var containerOrganizationInfo = item.Container.GetOrganizationInfo(); organizationInfo.AddRange(containerOrganizationInfo.Select(node => new OrganizationInfo.Node(node.ItemInfo, node.RelativePath))); organizationInfo.Last().RelativePath = "./"; return(organizationInfo); }
protected virtual string GetHtmlNavigation() { var htmlBuilder = new StringBuilder(); htmlBuilder.Append("<code>"); foreach (var node in OrganizationInfo.Take(OrganizationInfo.Count - 1)) { htmlBuilder.Append($"<a href=\"{node.RelativePath}index.html\">{HtmlEncoder.Default.Encode(node.ItemInfo.Name)}</a> / "); } htmlBuilder.Append(HtmlEncoder.Default.Encode(OrganizationInfo.Last().ItemInfo.Name)); htmlBuilder.Append("</code>"); return(htmlBuilder.ToString()); }