|
| 1 | +<?xml version='1.0' encoding='utf-8'?> |
| 2 | +<urlset xmlns:xsi = 'http://www.w3.org/2001/XMLSchema-instance' |
| 3 | + xmlns = 'http://www.sitemaps.org/schemas/sitemap/0.9' |
| 4 | + xmlns:image = 'http://www.google.com/schemas/sitemap-image/1.1' |
| 5 | + xmlns:video = 'http://www.google.com/schemas/sitemap-video/1.1' |
| 6 | + xmlns:news = 'http://www.google.com/schemas/sitemap-news/0.9' |
| 7 | + xmlns:mobile = 'http://www.google.com/schemas/sitemap-mobile/1.0' |
| 8 | + xmlns:pagemap = 'http://www.google.com/schemas/sitemap-pagemap/1.0' |
| 9 | + xmlns:xhtml = 'http://www.w3.org/1999/xhtml' |
| 10 | + xsi:schemaLocation = 'http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd'> |
| 11 | + |
| 12 | + <%= cache @last_modified do %> |
| 13 | + <%# homepage %> |
| 14 | + <%= render 'sitemap/url', loc: root_url, lastmod: @last_modified, changefreq: :daily, priority: 1.0 %> |
| 15 | + |
| 16 | + <%# default articles feed, for english articles %> |
| 17 | + <%= render 'sitemap/url', loc: feed_url, lastmod: @last_modified, changefreq: :daily, priority: 1.0 %> |
| 18 | + <% end %> |
| 19 | + |
| 20 | + <%# Atom feeds discovery page, for all languages with articles %> |
| 21 | + <%= render 'sitemap/url', loc: feeds_url, lastmod: @last_modified %> |
| 22 | + |
| 23 | + <%# articles feed, for all languages with articles %> |
| 24 | + <% @localized_feeds.each do |locale| %> |
| 25 | + <%# Atom feed %> |
| 26 | + <%= render 'sitemap/url', loc: feed_url(locale.abbreviation), lastmod: @last_modified %> |
| 27 | + |
| 28 | + <%# JSON feed (https://jsonfeed.org) %> |
| 29 | + <%= render 'sitemap/url', loc: json_feed_url(locale.abbreviation), lastmod: @last_modified %> |
| 30 | + <% end %> |
| 31 | + |
| 32 | + <%# categories %> |
| 33 | + <%= render 'sitemap/url', loc: categories_url, lastmod: @last_modified %> |
| 34 | + <% @categories.each do |category| %> |
| 35 | + <%# category Atom feeds %> |
| 36 | + <%= render 'sitemap/url', loc: category_feed_url(category.slug), lastmod: @last_modified %> |
| 37 | + <%# category JSON feeds %> |
| 38 | + <%= render 'sitemap/url', loc: category_json_feed_url(category.slug), lastmod: @last_modified %> |
| 39 | + <%# category pages %> |
| 40 | + <%= render 'sitemap/url', loc: category_url(category.slug), lastmod: @last_modified %> |
| 41 | + <% end %> |
| 42 | + |
| 43 | + <%# static-ish pages %> |
| 44 | + <% @static_paths.each do |path| %> |
| 45 | + <%= render 'sitemap/url', loc: [root_url, path].join('/'), lastmod: @last_modified %> |
| 46 | + <% end %> |
| 47 | + |
| 48 | + <%# article years %> |
| 49 | + <% @article_years.each do |year| %> |
| 50 | + <% lastmod = DateTime.new(year).end_of_day %> |
| 51 | + <% lastmod = @last_modified if year == Time.current.year %> |
| 52 | + |
| 53 | + <%= render 'sitemap/url', loc: article_archives_url(year: year), lastmod: lastmod %> |
| 54 | + <% end %> |
| 55 | + |
| 56 | + <%# To Change Everything (TCE) %> |
| 57 | + <%= render 'sitemap/url', loc: to_change_everything_url, lastmod: @last_modified %> |
| 58 | + |
| 59 | + <% @to_change_everything_languages.each do |tce_language| %> |
| 60 | + <%= render 'sitemap/url', loc: to_change_everything_url(lang: tce_language), lastmod: @last_modified %> |
| 61 | + <%= render 'sitemap/url', loc: [to_change_everything_url(lang: tce_language), '/get'].join, lastmod: @last_modified %> |
| 62 | + <% end %> |
| 63 | + |
| 64 | + <%# articles %> |
| 65 | + <% @articles.find_each do |article| %> |
| 66 | + <% cache article do %> |
| 67 | + <%= render 'sitemap/url', loc: [root_url, article.path].join, lastmod: article.updated_at %> |
| 68 | + <% end %> |
| 69 | + <% end %> |
| 70 | + |
| 71 | + <%# language pages %> |
| 72 | + <%= render 'sitemap/url', loc: languages_url, lastmod: @last_modified %> |
| 73 | + |
| 74 | + <% Locale.live.each do |locale| %> |
| 75 | + <% |
| 76 | + # TODO: move these URLs to routes/model/helper |
| 77 | + unicode_url = language_url locale.name.downcase.tr(' ', '-') |
| 78 | + slug_url = language_url locale.slug.to_sym |
| 79 | + english_url = language_url locale.name_in_english.downcase.tr(' ', '-') |
| 80 | + |
| 81 | + urls = [unicode_url, slug_url, english_url].uniq |
| 82 | + %> |
| 83 | + |
| 84 | + <% urls.each do |url| %> |
| 85 | + <%= render 'sitemap/url', loc: url, lastmod: @last_modified %> |
| 86 | + <% end %> |
| 87 | + <% end %> |
| 88 | + |
| 89 | + <%# support %> |
| 90 | + <%= render 'sitemap/url', loc: support_url, lastmod: @last_modified %> |
| 91 | + |
| 92 | + <%# search %> |
| 93 | + <%= render 'sitemap/url', loc: search_url, lastmod: @last_modified %> |
| 94 | + <%= render 'sitemap/url', loc: advanced_search_url, lastmod: @last_modified %> |
| 95 | + |
| 96 | + <%# tools %> |
| 97 | + <%# books %> |
| 98 | + <%= render 'sitemap/url', loc: books_url, lastmod: @last_modified %> |
| 99 | + <%= render 'sitemap/url', loc: books_extras_url(:work), lastmod: @last_modified %> |
| 100 | + <% @books.find_each do |book| %> |
| 101 | + <% cache book do %> |
| 102 | + <%= render 'sitemap/url', loc: book_url(book.slug), lastmod: book.updated_at %> |
| 103 | + <% end %> |
| 104 | + <% end %> |
| 105 | + |
| 106 | + <%# logos %> |
| 107 | + <%= render 'sitemap/url', loc: logos_url, lastmod: @last_modified %> |
| 108 | + <% @logos.find_each do |logo| %> |
| 109 | + <% cache logo do %> |
| 110 | + <%= render 'sitemap/url', loc: logo_url(logo.slug), lastmod: logo.updated_at %> |
| 111 | + <% end %> |
| 112 | + <% end %> |
| 113 | + |
| 114 | + <%# posters %> |
| 115 | + <%= render 'sitemap/url', loc: posters_url, lastmod: @last_modified %> |
| 116 | + <% @posters.find_each do |poster| %> |
| 117 | + <% cache poster do %> |
| 118 | + <%= render 'sitemap/url', loc: poster_url(poster.slug), lastmod: poster.updated_at %> |
| 119 | + <% end %> |
| 120 | + <% end %> |
| 121 | + |
| 122 | + <%# stickers %> |
| 123 | + <%= render 'sitemap/url', loc: stickers_url, lastmod: @last_modified %> |
| 124 | + <% @stickers.find_each do |sticker| %> |
| 125 | + <% cache sticker do %> |
| 126 | + <%= render 'sitemap/url', loc: sticker_url(sticker.slug), lastmod: sticker.updated_at %> |
| 127 | + <% end %> |
| 128 | + <% end %> |
| 129 | + |
| 130 | + <%# videos / music %> |
| 131 | + <%= render 'sitemap/url', loc: music_url, lastmod: @last_modified %> |
| 132 | + <%= render 'sitemap/url', loc: videos_url, lastmod: @last_modified %> |
| 133 | + <% @videos.find_each do |video| %> |
| 134 | + <% cache video do %> |
| 135 | + <%= render 'sitemap/url', loc: video_url(video.slug), lastmod: video.updated_at %> |
| 136 | + <% end %> |
| 137 | + <% end %> |
| 138 | + |
| 139 | + <%# zines %> |
| 140 | + <%= render 'sitemap/url', loc: zines_url, lastmod: @last_modified %> |
| 141 | + <% @zines.find_each do |zine| %> |
| 142 | + <% cache zine do %> |
| 143 | + <%= render 'sitemap/url', loc: zine_url(zine.slug), lastmod: zine.updated_at %> |
| 144 | + <% end %> |
| 145 | + <% end %> |
| 146 | + |
| 147 | + <%# journals / issues %> |
| 148 | + <%= render 'sitemap/url', loc: journals_url, lastmod: @last_modified %> |
| 149 | + <% @journals.find_each do |journal| %> |
| 150 | + <% cache journal do %> |
| 151 | + <%= render 'sitemap/url', loc: journal_url(journal.slug), lastmod: journal.updated_at %> |
| 152 | + |
| 153 | + <% journal.issues.each do |issue| %> |
| 154 | + <% cache issue do %> |
| 155 | + <%= render 'sitemap/url', |
| 156 | + loc: issue_url(slug: journal.slug, issue_number: issue.issue), |
| 157 | + lastmod: issue.updated_at %> |
| 158 | + <% end %> |
| 159 | + <% end %> |
| 160 | + <% end %> |
| 161 | + <% end %> |
| 162 | + |
| 163 | + <%# podcasts / episodes %> |
| 164 | + <%= render 'sitemap/url', loc: podcasts_url, lastmod: @last_modified %> |
| 165 | + <% @podcasts.find_each do |podcast| %> |
| 166 | + <% cache podcast do %> |
| 167 | + <%= render 'sitemap/url', loc: podcast_url(podcast.slug), lastmod: podcast.updated_at %> |
| 168 | + |
| 169 | + <% podcast.episodes.each do |episode| %> |
| 170 | + <% cache episode do %> |
| 171 | + <%= render 'sitemap/url', |
| 172 | + loc: episode_url(slug: podcast.slug, episode_number: episode.episode_number), |
| 173 | + lastmod: episode.updated_at %> |
| 174 | + <%= render 'sitemap/url', |
| 175 | + loc: episode_transcript_url(slug: podcast.slug, episode_number: episode.episode_number), |
| 176 | + lastmod: episode.updated_at %> |
| 177 | + <% end %> |
| 178 | + <% end %> |
| 179 | + <% end %> |
| 180 | + <% end %> |
| 181 | + |
| 182 | +</urlset> |
0 commit comments