Filter week posts on homepage

This commit is contained in:
2023-08-07 15:47:12 +10:00
parent e21b3fa2c3
commit b28bdb0427
4 changed files with 51 additions and 1 deletions

View File

@@ -94,6 +94,18 @@ module Adamantium
.to_a
end
def week_posts(limit: nil)
posts
.where(post_type: "post", location: nil)
.exclude(name: nil)
.weekly
.published
.combine(:tags)
.order(Sequel.desc(:published_at))
.limit(limit)
.to_a
end
def post_listing(limit: nil)
posts
.where(post_type: "post", location: nil)
@@ -105,6 +117,18 @@ module Adamantium
.to_a
end
def home_post_listing(limit: nil)
posts
.where(post_type: "post", location: nil)
.exclude(name: nil)
.non_weekly
.published
.combine(:tags)
.order(Sequel.desc(:published_at))
.limit(limit)
.to_a
end
def photo_listing(limit: nil)
posts
.where(post_type: ["post", "checkin"])