changeset 2394:938af1527606

Fix #21: Generate SisterSites page list
author Radomir Dopieralski <sheep-devel@sheep.art.pl>
date Sun, 12 May 2013 13:35:45 +0200
parents bc0e93311c8d
children ee3a73011cbc
files hatta/wiki.py
diffstat 1 files changed, 14 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/hatta/wiki.py	Sun May 12 12:51:13 2013 +0200
+++ b/hatta/wiki.py	Sun May 12 13:35:45 2013 +0200
@@ -755,6 +755,20 @@
         response.make_conditional(request)
         return response
 
+    @URL('/+sister-index')
+    def sister_pages(self, request):
+        """Show index of all pages in a fromat suitable for SisterPages."""
+
+        text = [
+            '%s%s %s\n' % (request.base_url, request.get_url(title), title)
+            for title in self.storage.all_pages()
+        ]
+        text.sort()
+        response = WikiResponse(text, mimetype='text/plain')
+        response.set_etag('/+sister-index/%d' % self.storage.repo_revision())
+        response.make_conditional(request)
+        return response
+
     @URL('/+orphaned')
     def orphaned(self, request):
         """Show all pages that don't have backlinks."""