ssg: StaticSiteClient: order and limit recent posts

This commit is contained in:
Nick Vella 2019-07-16 15:01:14 +10:00
parent 0d84ae9927
commit 4623753bd8
1 changed files with 2 additions and 0 deletions

View File

@ -79,6 +79,8 @@ namespace OpenLiveWriter.BlogClient.Clients.StaticSite
catch { return null; } catch { return null; }
}) })
.Where(post => post != null && (now == null || post.DatePublished < now)) .Where(post => post != null && (now == null || post.DatePublished < now))
.OrderByDescending(post => post.DatePublished)
.Take(maxPosts)
.ToArray(); .ToArray();
public string NewPost(string blogId, BlogPost post, INewCategoryContext newCategoryContext, bool publish, out string etag, out XmlDocument remotePost) public string NewPost(string blogId, BlogPost post, INewCategoryContext newCategoryContext, bool publish, out string etag, out XmlDocument remotePost)