瀏覽代碼

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