private IEnumerable <Post> GetPages() { if (Cache.Pages == null) { var pages = MarkdownParser.ParseFiles(HttpContext.Current.Server.MapPath("~/Content/Pages")); SearchProvider.AddToIndex(pages); Cache.Pages = pages; } return(Cache.Pages.Where(p => p.IsPublished)); }
private IEnumerable <Post> GetPosts() { if (Cache.Posts == null) { var posts = MarkdownParser.ParseFiles(HttpContext.Current.Server.MapPath("~/Content/Posts")); SearchProvider.AddToIndex(posts); Cache.Posts = posts; } return(Cache.Posts.Where(p => p.IsActive) .OrderByDescending(p => p.Date)); }