|
@@ -16,6 +16,15 @@ class SimpleSitemap(Sitemap):
|
|
|
return [object()]
|
|
|
|
|
|
|
|
|
+class EmptySitemap(Sitemap):
|
|
|
+ changefreq = "never"
|
|
|
+ priority = 0.5
|
|
|
+ location = '/location/'
|
|
|
+
|
|
|
+ def items(self):
|
|
|
+ return []
|
|
|
+
|
|
|
+
|
|
|
class FixedLastmodSitemap(SimpleSitemap):
|
|
|
lastmod = datetime(2013, 3, 13, 10, 0, 0)
|
|
|
|
|
@@ -37,6 +46,10 @@ simple_sitemaps = {
|
|
|
'simple': SimpleSitemap,
|
|
|
}
|
|
|
|
|
|
+empty_sitemaps = {
|
|
|
+ 'empty': EmptySitemap,
|
|
|
+}
|
|
|
+
|
|
|
fixed_lastmod_sitemaps = {
|
|
|
'fixed-lastmod': FixedLastmodSitemap,
|
|
|
}
|
|
@@ -62,6 +75,7 @@ urlpatterns = patterns('django.contrib.sitemaps.views',
|
|
|
(r'^simple/sitemap\.xml$', 'sitemap', {'sitemaps': simple_sitemaps}),
|
|
|
(r'^simple/custom-sitemap\.xml$', 'sitemap',
|
|
|
{'sitemaps': simple_sitemaps, 'template_name': 'custom_sitemap.xml'}),
|
|
|
+ (r'^empty/sitemap\.xml$', 'sitemap', {'sitemaps': empty_sitemaps}),
|
|
|
(r'^lastmod/sitemap\.xml$', 'sitemap', {'sitemaps': fixed_lastmod_sitemaps}),
|
|
|
(r'^lastmod-mixed/sitemap\.xml$', 'sitemap', {'sitemaps': fixed_lastmod__mixed_sitemaps}),
|
|
|
(r'^generic/sitemap\.xml$', 'sitemap', {'sitemaps': generic_sitemaps}),
|