seo: increase sitemap coverage.

Rework sitemaps to provide more coverage of the site. We want every
important page on the site - including every post, tag, and wiki page -
to be indexed by Google. We do this by generating sitemaps and sitemap
indexes that contain links to every important page on the site.
This commit is contained in:
evazion
2020-07-09 22:38:35 -05:00
parent d88a2a674f
commit 42f0112c38
21 changed files with 187 additions and 63 deletions

View File

@@ -14,11 +14,14 @@ class StaticControllerTest < ActionDispatch::IntegrationTest
end
context "sitemap action" do
should "work" do
create_list(:post, 3)
mock_post_search_rankings(Time.zone.yesterday, [["1girl", 100.0], ["2girls", 50.0]])
get sitemap_path, as: :xml
assert_response :success
[Artist, ForumTopic, Pool, Post, Tag, User, WikiPage].each do |klass|
should "work for #{klass.model_name.plural}" do
as(create(:user)) { create_list(klass.model_name.singular.to_sym, 3) }
get sitemap_path(sitemap: klass.model_name.plural), as: :xml
assert_response :success
assert_equal(1, response.parsed_body.css("sitemap loc").size)
end
end
end