表单: RailsNotes
用户: dreamable
创建日期: 2021-04-21 06:45:48 UTC
更新日期: 2021-04-21 06:47:37 UTC
引用:(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

标签: