/sitemap.xml: exclude posts that aren't visible.

This commit is contained in:
evazion
2020-01-12 22:58:22 -06:00
parent 3a2c050c91
commit 34c3df78d9

View File

@@ -19,6 +19,7 @@ class StaticController < ApplicationController
def sitemap
@popular_search_service = PopularSearchService.new(Date.yesterday)
@posts = Post.where("created_at > ?", 1.week.ago).order(score: :desc).limit(200)
@posts = @posts.select(&:visible?)
render layout: false
end
end