|
@@ -170,9 +170,15 @@ def printRecentMenu(count = 5):
|
170
|
170
|
for p in posts:
|
171
|
171
|
printMenuItem(p, False, False, False, True, "0", "", False)
|
172
|
172
|
|
173
|
|
-def printBlogMenu():
|
|
173
|
+def printBlogMenu(year_min=None, year_max=None):
|
174
|
174
|
posts = [p for p in pages if "post" in p and p.lang == "en"]
|
175
|
175
|
posts.sort(key=lambda p: p.get("date", "9999-01-01"), reverse=True)
|
|
176
|
+
|
|
177
|
+ if year_min != None:
|
|
178
|
+ posts = [p for p in posts if int(p.get("date", "9999-01-01")[0:4]) >= int(year_min)]
|
|
179
|
+ if year_max != None:
|
|
180
|
+ posts = [p for p in posts if int(p.get("date", "9999-01-01")[0:4]) <= int(year_max)]
|
|
181
|
+
|
176
|
182
|
lastyear = "0"
|
177
|
183
|
for p in posts:
|
178
|
184
|
lastyear = printMenuItem(p, True, False, False, True, lastyear)
|