Skip to content

Commit 5c74baa

Browse files
committed
Just post the path in Sitemap
1 parent d20e953 commit 5c74baa

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

app/workers/sitemap_refresh_worker.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ class SitemapRefreshWorker
44
sidekiq_options queue: :sitemap_generator
55

66
def perform
7-
# ArgumentError: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true
7+
# ArgumentError: Missing host to link to! Please provide the :host parameter, set default_path_options[:host], or set :only_path to true
88
SitemapGenerator::Sitemap.default_host = 'https://coderwall.com'
99
SitemapGenerator::Sitemap.public_path = 'tmp/'
1010
SitemapGenerator::Sitemap.sitemaps_host = "http://#{ENV['FOG_DIRECTORY']}.s3.amazonaws.com/"
@@ -23,22 +23,22 @@ def perform
2323
add('https://coderwall.com/employers', priority: 0.7, changefreq: 'monthly')
2424

2525
Protip.find_each(batch_size: 30) do |protip|
26-
add(protip_url(protip, host: 'coderwall.com', protocol: 'https'), lastmod: protip.updated_at, priority: 1.0)
26+
add(protip_path(protip), lastmod: protip.updated_at, priority: 1.0)
2727
end
2828

2929
Team.all.each do |team|
30-
add(teamname_url(slug: team.slug, host: 'coderwall.com', protocol: 'https'), lastmod: team.updated_at, priority: 0.9)
30+
add(teamname_path(slug: team.slug, host: 'coderwall.com', protocol: 'https'), lastmod: team.updated_at, priority: 0.9)
3131
team.jobs.each do |job|
32-
add(job_url(slug: team.slug, job_id: job.public_id, host: 'coderwall.com', protocol: 'https'), lastmod: job.updated_at, priority: 1.0)
32+
add(job_path(slug: team.slug, job_id: job.public_id), lastmod: job.updated_at, priority: 1.0)
3333
end
3434
end
3535

3636
User.find_each(batch_size: 30) do |user|
37-
add(badge_url(user.username, host: 'coderwall.com', protocol: 'https'), lastmod: user.updated_at, priority: 0.9)
37+
add(badge_path(user.username), lastmod: user.updated_at, priority: 0.9)
3838
end
3939

4040
BlogPost.all_public.each do |blog_post|
41-
add(blog_post_url(blog_post.id, host: 'coderwall.com', protocol: 'https'), lastmod: blog_post.posted, priority: 0.5)
41+
add(blog_post_path(blog_post.id), lastmod: blog_post.posted, priority: 0.5)
4242
end
4343
end
4444

0 commit comments

Comments
 (0)