Sitemap Generator

#7 Sitemap Generator
7/28/2015

Summary

Adding Search Engine Optimization to your site is easy. However, maintaining it can be difficult. This episode shows how to approach the sitemap indexing.
4
rails seo

Summary

Gemfile  gem 'sitemap_generator'
bash  rake sitemap:install
config/sitemap.rb  SitemapGenerator::Sitemap.default_host = "https://www.example.com"
  SitemapGenerator::Sitemap.create do
    add blogs_path, :priority => 0.5, :changefreq => 'daily'
    Blog.find_each do |blog|
      add blog_path(blog), :lastmod => blog.updated_at, :priority => 0.5
    end
  end
bash  #Generates the Sitemap
  rake sitemap:create

  #Generates and submits the Sitemap
  rake sitemap:refresh