-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsitemap.rb
40 lines (39 loc) · 1.33 KB
/
sitemap.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# Set the host name for URL creation
SitemapGenerator::Sitemap.default_host = "http://www.example.com"
SitemapGenerator::Sitemap.create do
# Put links creation logic here.
#
# The root path '/' and sitemap index file are added automatically for you.
# Links are added to the Sitemap in the order they are specified.
#
# Usage: add(path, options={})
# (default options are used if you don't specify)
#
# Defaults: :priority => 0.5, :changefreq => 'weekly',
# :lastmod => Time.now, :host => default_host
#
# Examples:
#
# Add '/articles'
#
# add articles_path, :priority => 0.7, :changefreq => 'daily'
#
# Add all articles:
#
# Article.find_each do |article|
# add article_path(article), :lastmod => article.updated_at
# end
User.all.each do |user|
add Sufia::Engine.routes.url_helpers.profile_path(user.email),
priority: 0.8, changefreq: 'daily'
end
read_group = Solrizer.solr_name('read_access_group', :symbol)
GenericWork.where(read_group => 'public').each do |f|
add Rails.application.routes.url_helpers.curation_concerns_generic_work_path(f),
priority: 1, changefreq: 'weekly'
end
Collection.where(read_group => 'public').each do |c|
add Rails.application.routes.url_helpers.collection_path(c),
priority: 1, changefreq: 'weekly'
end
end