Преглед на файлове

Set RECENT_ARTICLES_COUNT if user has not set it

Closes talha131/pelican-elegant#1
Talha Mansoor преди 11 години
родител
ревизия
99fcabcc17
променени са 2 файла, в които са добавени 4 реда и са изтрити 0 реда
  1. 1 0
      RELEASE_NOTES.md
  2. 3 0
      templates/index.html

+ 1 - 0
RELEASE_NOTES.md

@@ -9,6 +9,7 @@ Version 1.1 (under testing, stable)
 * Bug fix: Copyright meta tag should be set to the author, instead of the license
 * Bug fix: Close meta tags
 * Bug fix: ID of search form in 404 page should be different from the ID of search form in main navigation
+* Bug fix: If `RECENT_ARTICLES_COUNT` is undefined, set it to 10. So that Pelican does not throw critical error
 
 Version 1.0
 ===========

+ 3 - 0
templates/index.html

@@ -49,6 +49,9 @@ Home page of the {{ SITENAME|striptags }} blog.
             <h1 id="recent-posts">Recent Posts <a id="allposts" href="{{ SITEURL }}/archives.html">all posts</a></h1>
             </header>
             {% for article in articles %}
+            {% if not RECENT_ARTICLES_COUNT %}
+            {% set RECENT_ARTICLES_COUNT = 10 %}
+            {% endif %}
             {% if loop.index0 < RECENT_ARTICLES_COUNT %}
             <ul class="list-all-articles">
                 <li>