]> git.llucax.com Git - software/blitiri.git/commitdiff
Add an option to choose how many posts to show
authorLeandro Lucarella <llucax@gmail.com>
Tue, 1 Jun 2010 00:17:09 +0000 (21:17 -0300)
committerLeandro Lucarella <llucax@gmail.com>
Tue, 1 Jun 2010 02:20:01 +0000 (23:20 -0300)
blitiri.cgi
config.py.sample

index 78ee66b8f49913230d8f4cdd52a506d372decb14..abff92ab0f9225ac9cca376cdfb1efaa0adf0312 100755 (executable)
@@ -51,6 +51,9 @@ encoding = "utf8"
 # below for details.
 captcha_method = "title"
 
+# How many articles to show in the index
+index_articles = 10
+
 
 #
 # End of configuration
@@ -1215,7 +1218,7 @@ def handle_cgi():
        if atom:
                articles = db.get_articles(tags = tags)
                articles.sort(reverse = True)
-               render_atom(articles[:10])
+               render_atom(articles[:index_articles])
        elif style:
                render_style()
        elif post:
@@ -1278,7 +1281,7 @@ def handle_cgi():
                articles = db.get_articles(year, month, day, tags)
                articles.sort(reverse = True)
                if not year and not month and not day and not tags:
-                       articles = articles[:10]
+                       articles = articles[:index_articles]
                render_html(articles, db, year)
 
 
index 1b9d0776fef8a06fe23ddd5093c102b2cb8642a0..5a07da77e3885266be73acb2ad59f884a1083b5c 100644 (file)
@@ -47,3 +47,6 @@ encoding = "utf8"
 # blitiri.cgi for details.
 captcha_method = "title"
 
+# How many articles to show in the index
+index_articles = 10
+