I am using sitemap_generator for my rails app. I was able to generate sitemap for everything except for video links on the website. Following is my
sitemap.rb
Equipment.find_each do |e|
add search_equipments_path(e), :changefreq => 'weekly'
end
Equipment.find_each do |more|
add equipment_details_path(more), :changefreq => 'weekly'
end
Category.find_each do |c|
add search_equipments_path(:category_id=>c.id), :changefreq => 'weekly'
end
Category.find_each do |sub|
add search_equipments_path(:sub_category=>sub.id), :changefreq => 'weekly'
end
Service.find_each do |s|
add service_details_path(s), :changefreq => 'weekly'
end
WantedEquipment.find_each do |f|
add wanted_equipments_path(f), :changefreq => 'weekly'
end
StaticPage.find_each do |t|
add benefits_for_buyers_path(t), :changefreq => 'weekly'
end
StaticPage.find_each do |sel|
add benefits_for_sellers_path(sel), :changefreq=> 'weekly'
end
StaticPage.find_each do |ser|
add benefits_for_service_providers_path(ser), :changefreq=> 'weekly'
end
add '/about-us'
add '/terms-and-conditions'
add '/pricing-plans'
add '/how-it-work'
This what is given on the documentation on the gem page for generating video sitemap:
SitemapGenerator::Sitemap.create do
add('/index.html', :video => {
:thumbnail_loc => 'http://www.example.com/video1_thumbnail.png',
:title => 'Title',
:description => 'Description',
:content_loc => 'http://www.example.com/cool_video.mpg',
:tags => %w[one two three],
:category => 'Category'
})
end
I am not able to understand how to pass these values dynamically.
If you want to generate video contents on basis of
dynamic data, try this:Here
VideoInfois gem used for getting video meta info.