static void ConfigurePage(IDocumentMetadataCollection metadataCollection, DemoPage page, string title, string titleFormat) { if (page.Url != null) { metadataCollection.AddPage(page.Url) .OpenGraph("url", page.OG_Url) .OpenGraph("type", page.OG_Type) .OpenGraph("title", page.OG_Title) .OpenGraph("description", page.OG_Description) .OpenGraph("image", page.OG_Image) .Title(string.Format(titleFormat, title)) .Meta("description", page.Description); } if (page.DemoPages != null) { foreach (var demoPage in page.DemoPages) { ConfigurePage(metadataCollection, demoPage, string.Join('-', title, demoPage.Title), titleFormat); } } }
public static DemoPageSection[] GetPageSections(DemoPage basePage) { return(basePage.PageSections.Length > 0 ? basePage.PageSections : (ArePagesAsSections(basePage) ? basePage.Pages : Array.Empty <DemoPageSection>())); }