SEO work and resources page
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
SitemapGenerator::Sitemap.default_host = "http://hackingoff.com"
|
||||
|
||||
SitemapGenerator::Sitemap.create do
|
||||
routes = Rails.application.routes.routes.map do |route|
|
||||
{alias: route.name, path: route.path.spec.to_s, controller: route.defaults[:controller], action: route.defaults[:action]}
|
||||
end
|
||||
|
||||
# Set a list of controllers you don't want to generate routes for.
|
||||
# /rails/info in particular maps to something inaccessible.
|
||||
# redirects have a nil controller. This prevents duplicate content penalties.
|
||||
banned_controllers = ["rails/info", nil]
|
||||
routes.reject! {|route| banned_controllers.include?(route[:controller])}
|
||||
|
||||
# sitemap_generator includes root by default; prevent duplication
|
||||
routes.reject! {|route| route[:path] == '/'}
|
||||
|
||||
routes.each {|route| add route[:path][0..-11]} # Strips off '(.:format)
|
||||
|
||||
# Notice the below if you're hosting Jekyll/Octopress in a subdirectory
|
||||
# or otherwise want to index content outside of Rails' routes.
|
||||
# add_to_index '/path/sitemap.xml'
|
||||
@@ -0,0 +1,2 @@
|
||||
User-agent: *
|
||||
Disallow: /
|
||||
@@ -0,0 +1,3 @@
|
||||
User-agent: *
|
||||
Disallow: /translations/
|
||||
Disallow: /login/
|
||||
@@ -60,6 +60,9 @@ BikeBike::Application.routes.draw do
|
||||
get "oauth/callback" => "oauths#callback"
|
||||
get "oauth/:provider" => "oauths#oauth", :as => :auth_at_provider
|
||||
|
||||
get 'robots.txt' => 'pages#robots'
|
||||
get 'resources' => 'pages#resources'
|
||||
|
||||
root 'pages#home'
|
||||
|
||||
end
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
# Set the host name for URL creation
|
||||
SitemapGenerator::Sitemap.default_host = "http://bikebike.org"
|
||||
|
||||
SitemapGenerator::Sitemap.create do
|
||||
# Put links creation logic here.
|
||||
#
|
||||
# The root path '/' and sitemap index file are added automatically for you.
|
||||
# Links are added to the Sitemap in the order they are specified.
|
||||
#
|
||||
# Usage: add(path, options={})
|
||||
# (default options are used if you don't specify)
|
||||
#
|
||||
# Defaults: :priority => 0.5, :changefreq => 'weekly',
|
||||
# :lastmod => Time.now, :host => default_host
|
||||
#
|
||||
# Examples:
|
||||
#
|
||||
# Add '/articles'
|
||||
#
|
||||
# add articles_path, :priority => 0.7, :changefreq => 'daily'
|
||||
#
|
||||
# Add all articles:
|
||||
#
|
||||
# Article.find_each do |article|
|
||||
# add article_path(article), :lastmod => article.updated_at
|
||||
# end
|
||||
end
|
||||
Reference in New Issue
Block a user