Просмотр исходного кода

Merge pull request #290 from Keats/master

Fix sitemap with disabled pages (fix #206)
Justin Mayer лет назад: 10
Родитель
Сommit
5c76896246
1 измененных файлов с 4 добавлено и 0 удалено
  1. 4 0
      sitemap/sitemap.py

+ 4 - 0
sitemap/sitemap.py

@@ -134,6 +134,10 @@ class SitemapGenerator(object):
         if getattr(page, 'status', 'published') != 'published':
             return
 
+        # We can disable categories/authors/etc by using False instead of ''
+        if not page.save_as:
+            return
+
         page_path = os.path.join(self.output_path, page.save_as)
         if not os.path.exists(page_path):
             return