Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
railsdevs.com/config/sitemap.rb /
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
37 lines (30 sloc)
1.61 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require "aws-sdk-s3" | |
| SitemapGenerator::Sitemap.default_host = "https://railsdevs.com" | |
| SitemapGenerator::Sitemap.public_path = "tmp" | |
| SitemapGenerator::Sitemap.sitemaps_host = Rails.configuration.sitemaps_host | |
| SitemapGenerator::Sitemap.sitemaps_path = "sitemaps/" | |
| if Rails.configuration.upload_sitemap | |
| SitemapGenerator::Sitemap.adapter = SitemapGenerator::AwsSdkAdapter.new( | |
| Rails.application.credentials.dig(:aws, :sitemaps_bucket), | |
| aws_access_key_id: Rails.application.credentials.dig(:aws, :access_key_id), | |
| aws_secret_access_key: Rails.application.credentials.dig(:aws, :secret_access_key), | |
| aws_region: Rails.application.credentials.dig(:aws, :region) | |
| ) | |
| end | |
| SitemapGenerator::Sitemap.create do | |
| add root_path, changefreq: "always", priority: 1, lastmod: Developer.visible.maximum(:updated_at) | |
| add developers_path, changefreq: "always", priority: 1, lastmod: Developer.visible.maximum(:updated_at) | |
| add pricing_path, changefreq: "weekly", priority: 0.9 | |
| add about_path, changefreq: "monthly", priority: 0.9 | |
| Developer.visible.newest_first.find_each do |developer| | |
| add developer_path(id: developer.hashid), changefreq: "always", priority: 0.8, lastmod: developer.updated_at | |
| end | |
| add new_user_session_path, changefreq: "weekly", priority: 0.7 | |
| add new_user_registration_path, changefreq: "weekly", priority: 0.7 | |
| add new_user_password_path, changefreq: "monthly", priority: 0.7 | |
| add new_user_confirmation_path, changefreq: "monthly", priority: 0.7 | |
| add new_role_path, changefreq: "weekly", priority: 0.6 | |
| Developers::QueryPath.all.each do |path| | |
| add path, changefreq: "weekly", priority: 1 | |
| end | |
| end |