Remove sitemap as it is not needed
This commit is contained in:
parent
691f84910a
commit
9137744c69
1
Gemfile
1
Gemfile
|
@ -57,7 +57,6 @@ gem 'compass-rails'
|
||||||
gem 'uglifier'
|
gem 'uglifier'
|
||||||
gem 'therubyracer', platforms: [:mri, :rbx]
|
gem 'therubyracer', platforms: [:mri, :rbx]
|
||||||
gem 'therubyrhino', platforms: :jruby
|
gem 'therubyrhino', platforms: :jruby
|
||||||
gem 'sitemap_generator'
|
|
||||||
|
|
||||||
source 'https://rails-assets.org' do
|
source 'https://rails-assets.org' do
|
||||||
gem 'rails-assets-notifyjs'
|
gem 'rails-assets-notifyjs'
|
||||||
|
|
|
@ -1,10 +1,6 @@
|
||||||
class SitemapController < ApplicationController
|
class SitemapController < ApplicationController
|
||||||
skip_after_action :verify_authorized
|
skip_after_action :verify_authorized
|
||||||
|
|
||||||
def show
|
|
||||||
redirect_to "/sitemaps/#{request.host_with_port.gsub(/www./, '')}/sitemap.xml.gz"
|
|
||||||
end
|
|
||||||
|
|
||||||
def robots
|
def robots
|
||||||
render file: 'sitemap/robots', layout: false, content_type: Mime::TEXT
|
render file: 'sitemap/robots', layout: false, content_type: Mime::TEXT
|
||||||
end
|
end
|
||||||
|
|
|
@ -3,4 +3,3 @@
|
||||||
User-agent: *
|
User-agent: *
|
||||||
Disallow: /
|
Disallow: /
|
||||||
Host: <%= root_url.gsub(/\/$/, '') %>
|
Host: <%= root_url.gsub(/\/$/, '') %>
|
||||||
Sitemap: <%= sitemap_url %>
|
|
||||||
|
|
|
@ -9,8 +9,6 @@ Rails.application.routes.draw do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# Redirect sitemap1.xml.gz file on AWS S3
|
|
||||||
match '/sitemap.xml.gz' => 'sitemap#show', via: [:get, :post, :head], as: :sitemap
|
|
||||||
match '/robots.txt' => 'sitemap#robots', via: [:get, :post, :head], as: :robots
|
match '/robots.txt' => 'sitemap#robots', via: [:get, :post, :head], as: :robots
|
||||||
|
|
||||||
resources :statistics, only: [:index]
|
resources :statistics, only: [:index]
|
||||||
|
|
|
@ -1,58 +0,0 @@
|
||||||
%w(abf.openmandriva.org).each do |domain|
|
|
||||||
|
|
||||||
SitemapGenerator::Sitemap.create(
|
|
||||||
default_host: "https://#{domain}",
|
|
||||||
sitemaps_path: "sitemaps/#{domain}"
|
|
||||||
) do
|
|
||||||
|
|
||||||
# root
|
|
||||||
add(root_path)
|
|
||||||
|
|
||||||
# Projects
|
|
||||||
Project.opened.find_each do |project|
|
|
||||||
add(project_path(project), lastmod: project.updated_at)
|
|
||||||
end
|
|
||||||
|
|
||||||
# BuildLists
|
|
||||||
BuildList.for_status(BuildList::BUILD_PUBLISHED).
|
|
||||||
where(platforms: { visibility: 'open' }, projects: { visibility: 'open' }).
|
|
||||||
joins(:save_to_platform, :project).
|
|
||||||
find_each do |bl|
|
|
||||||
add(build_list_path(bl), lastmod: bl.updated_at)
|
|
||||||
end
|
|
||||||
|
|
||||||
# Platforms
|
|
||||||
Platform.opened.find_each do |platform|
|
|
||||||
add(platform_path(platform), lastmod: platform.updated_at)
|
|
||||||
|
|
||||||
# Repositories
|
|
||||||
add(platform_repositories_path(platform), lastmod: platform.updated_at)
|
|
||||||
platform.repositories.find_each do |repository|
|
|
||||||
add(platform_repository_path(platform, repository), lastmod: repository.updated_at)
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
# Products
|
|
||||||
add(platform_products_path(platform), lastmod: platform.updated_at)
|
|
||||||
platform.products.find_each do |product|
|
|
||||||
add(platform_product_path(platform, product), lastmod: product.updated_at)
|
|
||||||
|
|
||||||
# ProductBuildList (ISO)
|
|
||||||
product.product_build_lists.for_status(ProductBuildList::BUILD_COMPLETED).find_each do |pbl|
|
|
||||||
add(platform_product_product_build_list_path(platform, product, pbl), lastmod: pbl.updated_at)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
# Users
|
|
||||||
User.find_each do |user|
|
|
||||||
add(user_path(user), lastmod: user.updated_at)
|
|
||||||
end
|
|
||||||
|
|
||||||
# Groups
|
|
||||||
Group.find_each do |group|
|
|
||||||
add(group_path(group), lastmod: group.updated_at)
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
|
||||||
end
|
|
Loading…
Reference in New Issue