forked from seek4science/seek
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request seek4science#1578 from seek4science/sitemap
Sitemaps
- Loading branch information
Showing
5 changed files
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# https://github.com/kjvarga/sitemap_generator#sitemapgenerator | ||
SitemapGenerator::Sitemap.sitemaps_path = "sitemaps" | ||
SitemapGenerator::Sitemap.create_index = "auto" | ||
SitemapGenerator::Sitemap.compress = false | ||
SitemapGenerator::Sitemap.default_host = URI.parse(Seek::Config.site_base_url) | ||
|
||
SitemapGenerator::Sitemap.create do | ||
Seek::Util.searchable_types.each do |type| | ||
add polymorphic_path(type), lastmod: type.maximum(:updated_at), changefreq: 'daily', priority: 0.7 | ||
end | ||
end | ||
|
||
Seek::Util.searchable_types.each do |type| | ||
SitemapGenerator::Sitemap.create(filename: type.table_name, include_root: false) do | ||
type.authorized_for('view', nil).find_all do |obj| | ||
add polymorphic_path(obj), lastmod: obj.updated_at, changefreq: 'daily', priority: 0.7 | ||
end | ||
end | ||
end |