Table: RailsNotes
User: dreamable
Created at: 2021-04-21 06:45:48 UTC
Updated at: 2021-04-21 06:47:37 UTC
Reference:(Table ID 3, Record ID 38)

标题 :
Rails Sitemap
笔记 :
  • Use the 'sitemap_generator' gem
  • Installation

    • Add to Gemfile gem 'sitemap_generator'
    • Generate config/sitemap.rb
     bundle install
     rake sitemap:install
    
    • edit the config/sitemap.rb
      • specify the domain
      • add links
      • test by rails -s sitemap:refresh, which will ping search engine by default.
  • Setup crontab to refresh daily

  • Add the link to robot.txt

    Sitemap: https://www.example.com/sitemap.xml.gz
    
  • Add the link in Google search console

Tag: