Explorar o código

Merge pull request #696 from ziogaschr/sitemap_template_pages

Sitemap plugin: Parse template_pages and write them in sitemap
Justin Mayer %!s(int64=8) %!d(string=hai) anos
pai
achega
315d731fbf
Modificáronse 1 ficheiros con 13 adicións e 0 borrados
  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)