ソースを参照

Merge pull request #290 from Keats/master

Fix sitemap with disabled pages (fix #206)
Justin Mayer 10 年 前
コミット
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