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