|
1 | 1 | SitemapGenerator::Sitemap.default_host = 'https://registry.seqco.de' |
2 | | -SitemapGenerator::Sitemap.sitemaps_path = 'sitemaps/' |
3 | | -SitemapGenerator::Sitemap.sitemaps_host = '%s/%s' % [ |
4 | | - SitemapGenerator::Sitemap.default_host, |
5 | | - SitemapGenerator::Sitemap.sitemaps_path |
6 | | -] |
| 2 | +SitemapGenerator::Sitemap.sitemaps_path = '/' |
7 | 3 |
|
8 | | -# Global index |
9 | | -SitemapGenerator::Sitemap.adapter = SitemapGenerator::FileAdapter.new |
10 | | -SitemapGenerator::Sitemap.filename = 'sitemap.xml' |
11 | | -SitemapGenerator::Sitemap.create_index = true |
12 | | - |
13 | | -# Top-level pages |
14 | | -SitemapGenerator::Sitemap.namer = SitemapGenerator::SimpleNamer.new(:pages) |
15 | 4 | SitemapGenerator::Sitemap.create do |
16 | 5 | extend HelpTopics |
17 | | - add root_path, changefreq: :daily, priority: 1.0 |
18 | 6 |
|
19 | | - # Pages |
20 | | - add page_api_path, changefreq: :monthly, priority: 0.4 |
21 | | - add page_about_path, changefreq: :weekly, priority: 0.8 |
22 | | - add page_committee_path, changefreq: :monthly, priority: 0.6 |
23 | | - add page_news_path, changefreq: :monthly, priority: 0.6 |
24 | | - add page_prize_path, changefreq: :monthly, priority: 0.4 |
25 | | - add page_publications_path, changefreq: :monthly, priority: 0.4 |
26 | | - add page_seqcode_path, changefreq: :monthly, priority: 0.8 |
| 7 | + # Global index |
| 8 | + # %w[pages names genomes strains registers].each do |base| |
| 9 | + # add_to_index 'sitemaps/%s.xml.gz' % base |
| 10 | + # end |
| 11 | + |
| 12 | + # Top-level pages |
| 13 | + group(filename: :pages, sitemaps_path: 'sitemaps/') do |
| 14 | + add root_path, changefreq: :daily, priority: 1.0 |
| 15 | + |
| 16 | + # Pages |
| 17 | + add page_api_path, changefreq: :monthly, priority: 0.4 |
| 18 | + add page_about_path, changefreq: :weekly, priority: 0.8 |
| 19 | + add page_committee_path, changefreq: :monthly, priority: 0.6 |
| 20 | + add page_news_path, changefreq: :monthly, priority: 0.6 |
| 21 | + add page_prize_path, changefreq: :monthly, priority: 0.4 |
| 22 | + add page_publications_path, changefreq: :monthly, priority: 0.4 |
| 23 | + add page_seqcode_path, changefreq: :monthly, priority: 0.8 |
27 | 24 |
|
28 | | - # Help |
29 | | - add help_index_path, changefreq: :weekly, priority: 0.8 |
30 | | - help_topics.each do |_cat, topics| |
31 | | - topics.each do |topic, _data| |
32 | | - add help_path(topic: topic), changefreq: :monthly, priority: 0.8 |
| 25 | + # Help |
| 26 | + add help_index_path, changefreq: :weekly, priority: 0.8 |
| 27 | + help_topics.each do |_cat, topics| |
| 28 | + topics.each do |topic, _data| |
| 29 | + add help_path(topic: topic), changefreq: :monthly, priority: 0.8 |
| 30 | + end |
33 | 31 | end |
34 | | - end |
35 | 32 |
|
36 | | - # User registration |
37 | | - add '/sign_up', changefreq: :monthly, priority: 0.5 |
38 | | - add '/login', changefreq: :monthly, priority: 0.5 |
| 33 | + # User registration |
| 34 | + add '/sign_up', changefreq: :monthly, priority: 0.5 |
| 35 | + add '/login', changefreq: :monthly, priority: 0.5 |
39 | 36 |
|
40 | | - # Indexes |
41 | | - add name_type_genomes_path, changefreq: :weekly, priority: 0.6 |
42 | | - add names_path, changefreq: :daily, priority: 0.8 |
43 | | - add submitted_names_path, changefreq: :daily, priority: 0.8 |
44 | | - add endorsed_names_path, changefreq: :daily, priority: 0.8 |
45 | | - add strains_path, changefreq: :daily, priority: 0.6 |
46 | | - add registers_path, changefreq: :weekly, priority: 0.8 |
47 | | - add authors_path, changefreq: :daily, priority: 0.4 |
48 | | - add journals_path, changefreq: :monthly, priority: 0.4 |
49 | | - add publications_path, changefreq: :daily, priority: 0.4 |
50 | | - add subjects_path, changefreq: :monthly, priority: 0.2 |
51 | | - add search_path, changefreq: :monthly, priority: 0.2 |
52 | | -end |
| 37 | + # Indexes |
| 38 | + add name_type_genomes_path, changefreq: :weekly, priority: 0.6 |
| 39 | + add names_path, changefreq: :daily, priority: 0.8 |
| 40 | + add submitted_names_path, changefreq: :daily, priority: 0.8 |
| 41 | + add endorsed_names_path, changefreq: :daily, priority: 0.8 |
| 42 | + add strains_path, changefreq: :daily, priority: 0.6 |
| 43 | + add registers_path, changefreq: :weekly, priority: 0.8 |
| 44 | + add authors_path, changefreq: :daily, priority: 0.4 |
| 45 | + add journals_path, changefreq: :monthly, priority: 0.4 |
| 46 | + add publications_path, changefreq: :daily, priority: 0.4 |
| 47 | + add subjects_path, changefreq: :monthly, priority: 0.2 |
| 48 | + add search_path, changefreq: :monthly, priority: 0.2 |
| 49 | + end |
53 | 50 |
|
54 | | -# Names |
55 | | -SitemapGenerator::Sitemap.namer = SitemapGenerator::SimpleNamer.new(:names) |
56 | | -SitemapGenerator::Sitemap.create do |
57 | | - Name.all_public.find_each do |name| |
58 | | - add name_path(name), lastmod: name.updated_at, |
59 | | - changefreq: :weekly, priority: 0.6 |
60 | | - add wiki_name_path(name), lastmod: name.updated_at, |
61 | | - changefreq: :weekly, priority: 0.1 |
62 | | - # TODO: |
63 | | - # - add network |
| 51 | + # Names |
| 52 | + group(filename: :names, sitemaps_path: 'sitemaps/') do |
| 53 | + Name.all_public.find_each do |name| |
| 54 | + add name_path(name), lastmod: name.updated_at, |
| 55 | + changefreq: :weekly, priority: 0.6 |
| 56 | + add wiki_name_path(name), lastmod: name.updated_at, |
| 57 | + changefreq: :weekly, priority: 0.1 |
| 58 | + # TODO: |
| 59 | + # - add network |
| 60 | + end |
64 | 61 | end |
65 | | -end |
66 | 62 |
|
67 | | -# Genomes |
68 | | -SitemapGenerator::Sitemap.namer = SitemapGenerator::SimpleNamer.new(:genomes) |
69 | | -SitemapGenerator::Sitemap.create do |
70 | | - Genome.all_public.find_each do |genome| |
71 | | - add genome_path(genome), lastmod: genome.updated_at, |
72 | | - changefreq: :weekly, priority: 0.4 |
73 | | - # TODO: |
74 | | - # - add sample_map |
| 63 | + # Genomes |
| 64 | + group(filename: :genomes, sitemaps_path: 'sitemaps/') do |
| 65 | + Genome.all_public.find_each do |genome| |
| 66 | + add genome_path(genome), lastmod: genome.updated_at, |
| 67 | + changefreq: :weekly, priority: 0.4 |
| 68 | + # TODO: |
| 69 | + # - add sample_map |
| 70 | + end |
75 | 71 | end |
76 | | -end |
77 | 72 |
|
78 | | -# Strains |
79 | | -SitemapGenerator::Sitemap.namer = SitemapGenerator::SimpleNamer.new(:strains) |
80 | | -SitemapGenerator::Sitemap.create do |
81 | | - Strain.find_each do |strain| |
82 | | - add strain_path(strain), lastmod: strain.updated_at, |
83 | | - changefreq: :weekly, priority: 0.4 |
| 73 | + # Strains |
| 74 | + group(filename: :strains, sitemaps_path: 'sitemaps/') do |
| 75 | + Strain.find_each do |strain| |
| 76 | + add strain_path(strain), lastmod: strain.updated_at, |
| 77 | + changefreq: :weekly, priority: 0.4 |
| 78 | + end |
84 | 79 | end |
85 | | -end |
86 | 80 |
|
87 | | -# Registers |
88 | | -SitemapGenerator::Sitemap.namer = SitemapGenerator::SimpleNamer.new(:registers) |
89 | | -SitemapGenerator::Sitemap.create do |
90 | | - Register.where(validated: true).find_each do |register| |
91 | | - add register_path(register), lastmod: register.updated_at, |
92 | | - changefreq: :weekly, priority: 0.6 |
93 | | - # TODO: |
94 | | - # - add table |
95 | | - # - add list |
96 | | - # - add sample_map |
97 | | - # - add tree |
| 81 | + # Registers |
| 82 | + group(filename: :registers, sitemaps_path: 'sitemaps/') do |
| 83 | + SitemapGenerator::Sitemap.create do |
| 84 | + Register.where(validated: true).find_each do |register| |
| 85 | + add register_path(register), lastmod: register.updated_at, |
| 86 | + changefreq: :weekly, priority: 0.6 |
| 87 | + # TODO: |
| 88 | + # - add table |
| 89 | + # - add list |
| 90 | + # - add sample_map |
| 91 | + # - add tree |
| 92 | + end |
98 | 93 | end |
99 | | -end |
100 | 94 |
|
101 | | -# TODO Add members for: |
102 | | -# - authors |
103 | | -# - journals |
104 | | -# - publications |
105 | | -# - subjects |
| 95 | + # TODO Add members for: |
| 96 | + # - authors |
| 97 | + # - journals |
| 98 | + # - publications |
| 99 | + # - subjects |
| 100 | + |
| 101 | +end |
106 | 102 |
|
0 commit comments