diff --git a/modules/ublog/src/main/UblogApi.scala b/modules/ublog/src/main/UblogApi.scala index 38b2153ec1417..813f5b72750f3 100644 --- a/modules/ublog/src/main/UblogApi.scala +++ b/modules/ublog/src/main/UblogApi.scala @@ -79,7 +79,7 @@ final class UblogApi( def latestPosts(blogId: UblogBlog.Id, nb: Int): Fu[List[UblogPost.PreviewPost]] = colls.post .find($doc("blog" -> blogId, "live" -> true), previewPostProjection.some) - .sort($doc("sticky" -> -1, "lived.at" -> -1)) + .sort(userLiveSort) .cursor[UblogPost.PreviewPost](ReadPref.sec) .list(nb) diff --git a/modules/ublog/src/main/UblogBsonHandlers.scala b/modules/ublog/src/main/UblogBsonHandlers.scala index cfff8d95824e7..7062ccbd4bf3e 100644 --- a/modules/ublog/src/main/UblogBsonHandlers.scala +++ b/modules/ublog/src/main/UblogBsonHandlers.scala @@ -34,3 +34,5 @@ private object UblogBsonHandlers: "topics" -> true, "sticky" -> true ) + + val userLiveSort = $doc("sticky" -> -1, "lived.at" -> -1) diff --git a/modules/ublog/src/main/UblogPaginator.scala b/modules/ublog/src/main/UblogPaginator.scala index e07d840de9a91..a213387068a17 100644 --- a/modules/ublog/src/main/UblogPaginator.scala +++ b/modules/ublog/src/main/UblogPaginator.scala @@ -29,7 +29,7 @@ final class UblogPaginator( collection = colls.post, selector = $doc("blog" -> blog, "live" -> live), projection = previewPostProjection.some, - sort = if live then $doc("lived.at" -> -1) else $doc("created.at" -> -1), + sort = if live then userLiveSort else $doc("created.at" -> -1), _.sec ), currentPage = page, diff --git a/translation/source/ublog.xml b/translation/source/ublog.xml index e23bcad13f1ef..2326c5478d199 100644 --- a/translation/source/ublog.xml +++ b/translation/source/ublog.xml @@ -22,7 +22,7 @@ Publish on your blog If checked, the post will be listed on your blog. If not, it will be private, in your draft posts Sticky post - If checked, this post will be listed first in your profile recent posts. + If checked, this post will be listed first in your profile recent posts and on your blog. Published a blog post Published %s blog posts diff --git a/ui/@types/lichess/i18n.d.ts b/ui/@types/lichess/i18n.d.ts index 303970a32ce33..d648b8d9c81a6 100644 --- a/ui/@types/lichess/i18n.d.ts +++ b/ui/@types/lichess/i18n.d.ts @@ -5457,7 +5457,7 @@ interface I18n { selectPostTopics: string; /** Sticky post */ stickyPost: string; - /** If checked, this post will be listed first in your profile recent posts. */ + /** If checked, this post will be listed first in your profile recent posts and on your blog. */ stickyPostHelp: string; /** This is a draft */ thisIsADraft: string;