Browse Source

explain how the archive size works

oz123 11 năm trước cách đây
mục cha
commit
f7ee4b2a9e
1 tập tin đã thay đổi với 6 bổ sung1 xóa
  1. 6 1
      blogit.py

+ 6 - 1
blogit.py

@@ -64,6 +64,11 @@ CONFIG = {
     'content_encoding': 'utf-8',
 }
 
+# EDIT THIS PARAMETER TO CHANGE ARCHIVE SIZE
+# 0 Means that all the entries will be in the archive
+# 10 meas that all the entries except the last 10
+ARCHIVE_SIZE = 0
+
 GLOBAL_TEMPLATE_CONTEXT = {
     'media_base': '/media/',
     'media_url': '../media/',
@@ -348,7 +353,7 @@ def render_archive(entries, render_to=None):
     this function creates the archive page
     """
     context = GLOBAL_TEMPLATE_CONTEXT.copy()
-    context['entries'] = entries[10:]
+    context['entries'] = entries[ARCHIVE_SIZE:]
     template = jinja_env.get_template('archive_index.html')
     html = template.render(context)
     if not render_to: