extend sitemap

This commit is contained in:
Andreas Stephanides
2014-12-08 14:29:01 +01:00
parent bd3c6054fb
commit 276496635f
2 changed files with 36 additions and 1 deletions

1
.gitignore vendored
View File

@@ -30,6 +30,7 @@ Gemfile.lock
console console
/server /server
/public/uploads/ /public/uploads/
/public/sitemap*
/vendor/* /vendor/*
/bak/* /bak/*
/solr/* /solr/*

View File

@@ -1,8 +1,43 @@
# Set the host name for URL creation # Set the host name for URL creation
require 'rubygems'
require 'sitemap_generator'
SitemapGenerator::Sitemap.default_host = "http://localhost:3000" SitemapGenerator::Sitemap.default_host = "http://localhost:3000"
SitemapGenerator::Sitemap.create do SitemapGenerator::Sitemap.create do
add root_path add root_path
Globalize.with_locale(:de) do
add studien_path(:theme=>nil, :locale=>:de)
add fetprofiles_path(:theme=>nil)
Gremium.find_each do |gremium|
add gremium_path(gremium ,:theme=>nil,:locale=>:de)
end
Studium.find_each do |studium|
add studium_path(studium ,:theme=>nil,:locale=>:de,:ansicht=>:semesteransicht)
end
Lva.find_each do |lva|
add lva_path(lva ,:theme=>nil,:locale=>:de)
end
Modul.find_each do |modul|
add modul_path(modul ,:theme=>nil,:locale=>:de)
end
end
Globalize.with_locale(:en) do
add studien_path(:theme=>nil, :locale=>:en)
add fetprofiles_path(:theme=>nil)
Gremium.find_each do |gremium|
add gremium_path(gremium ,:theme=>nil,:locale=>:en)
end
Studium.find_each do |studium|
add studium_path(studium ,:theme=>nil,:locale=>:en,:ansicht=>:semesteransicht)
end
Lva.find_each do |lva|
add lva_path(lva ,:theme=>nil,:locale=>:en)
end
Modul.find_each do |modul|
add modul_path(modul ,:theme=>nil,:locale=>:en)
end
end
Globalize.with_locale(:de) do Globalize.with_locale(:de) do
Neuigkeit.public.find_each do |neuigkeit| Neuigkeit.public.find_each do |neuigkeit|
add neuigkeit_path(neuigkeit,:locale=>:de,:theme=>"default"),:lastmod=>neuigkeit.updated_at, :news=>{:title=>neuigkeit.title, :publication_language=>"de", :publication_date=>neuigkeit.datum} add neuigkeit_path(neuigkeit,:locale=>:de,:theme=>"default"),:lastmod=>neuigkeit.updated_at, :news=>{:title=>neuigkeit.title, :publication_language=>"de", :publication_date=>neuigkeit.datum}
@@ -22,7 +57,6 @@ SitemapGenerator::Sitemap.create do
Thema.public.with_translations(:de).find_each do |thema| Thema.public.with_translations(:de).find_each do |thema|
add thema_path(thema, :locale=>:de, :theme=>"default"),:lastmod=>thema.updated_at, :alternate=>{:href=>thema_path(thema, :locale=>:de, :theme=>"blue1"), :lang=>"de"} add thema_path(thema, :locale=>:de, :theme=>"default"),:lastmod=>thema.updated_at, :alternate=>{:href=>thema_path(thema, :locale=>:de, :theme=>"blue1"), :lang=>"de"}
end end
end end
# Put links creation logic here. # Put links creation logic here.
# #