forked from e621ng/e621ng
Remove broken sitemap.xml
This commit is contained in:
parent
fbe565817b
commit
d15acddca1
@ -1,7 +1,7 @@
|
||||
class StaticController < ApplicationController
|
||||
def terms_of_service
|
||||
end
|
||||
|
||||
|
||||
def accept_terms_of_service
|
||||
cookies.permanent[:accepted_tos] = "1"
|
||||
url = params[:url] if params[:url] && params[:url].start_with?("/")
|
||||
@ -17,11 +17,4 @@ class StaticController < ApplicationController
|
||||
|
||||
def site_map
|
||||
end
|
||||
|
||||
def sitemap
|
||||
@popular_search_service = PopularSearchService.new(Date.yesterday)
|
||||
@post_set = PostSets::Popular.new(Date.yesterday.to_s, "week", limit: 200)
|
||||
@posts = @post_set.posts
|
||||
render layout: false
|
||||
end
|
||||
end
|
||||
|
@ -1,41 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
|
||||
xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">
|
||||
<url>
|
||||
<loc><%= posts_url %></loc>
|
||||
<changefreq>daily</changefreq>
|
||||
</url>
|
||||
<url>
|
||||
<loc><%= wiki_pages_url %></loc>
|
||||
<changefreq>daily</changefreq>
|
||||
</url>
|
||||
<url>
|
||||
<loc><%= pools_url %></loc>
|
||||
<changefreq>daily</changefreq>
|
||||
</url>
|
||||
|
||||
<% cache("sitemap", :expires_in => 24.hours) do %>
|
||||
<% @popular_search_service.each_search do |tags, count| %>
|
||||
<url>
|
||||
<loc><%= posts_url(tags: tags) %></loc>
|
||||
<lastmod><%= Date.today %></lastmod>
|
||||
</url>
|
||||
<% end %>
|
||||
|
||||
<% @posts.each do |post| %>
|
||||
<url>
|
||||
<loc><%= post_url(post) %></loc>
|
||||
<image:image>
|
||||
<image:loc>
|
||||
<%= post.file_url %>
|
||||
</image:loc>
|
||||
<image:caption>
|
||||
<%= post.presenter.humanized_essential_tag_string %>
|
||||
</image:caption>
|
||||
</image:image>
|
||||
<lastmod><%= post.created_at.to_date %></lastmod>
|
||||
</url>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</urlset>
|
@ -497,7 +497,6 @@ Rails.application.routes.draw do
|
||||
get "/wiki/recent_changes" => redirect {|params, req| "/wiki_page_versions?search[updater_id]=#{req.params[:user_id]}"}
|
||||
get "/wiki/history/:title" => redirect("/wiki_page_versions?title=%{title}")
|
||||
|
||||
get "/sitemap" => "static#sitemap"
|
||||
get "/static/keyboard_shortcuts" => "static#keyboard_shortcuts", :as => "keyboard_shortcuts"
|
||||
get "/static/bookmarklet" => "static#bookmarklet", :as => "bookmarklet"
|
||||
get "/static/site_map" => "static#site_map", :as => "site_map"
|
||||
|
Loading…
Reference in New Issue
Block a user