浏览代码

Merge pull request #696 from ziogaschr/sitemap_template_pages

Sitemap plugin: Parse template_pages and write them in sitemap
Justin Mayer 8 年之前
父节点
当前提交
315d731fbf
共有 1 个文件被更改,包括 13 次插入0 次删除
  1. 13 0
      sitemap/sitemap.py

+ 13 - 0
sitemap/sitemap.py

@@ -239,6 +239,19 @@ class SitemapGenerator(object):
                                 save_as=standard_page_url)
                 self.write_url(fake, fd)
 
+            # add template pages
+            for path, template_page_url in self.context['TEMPLATE_PAGES'].iteritems():
+
+                # don't add duplicate entry for index page
+                if template_page_url == 'index.html':
+                    continue
+
+                fake = FakePage(status='published',
+                                date=self.now,
+                                url=template_page_url,
+                                save_as=template_page_url)
+                self.write_url(fake, fd)
+
             for page in pages:
                 self.write_url(page, fd)