# Set the host name for URL creation
SitemapGenerator::Sitemap.default_host = "https://golovinamari.com"

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:
  #

  Variant.active.find_each do |variant|
    add catalog_variant_path(slug: variant.category.slug, id: variant), lastmod: variant.updated_at
  end

  Category.active.find_each do |category|
    add catalog_category_path(slug: category.slug), lastmod: Time.current
  end
end
