Skip to content

Commit 1f7875c

Browse files
committed
Sort months properly
1 parent 34851e4 commit 1f7875c

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

app.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ def get_posts():
2727
link_to_post = "/post?date=" + yaml_file
2828
# collect datetime info
2929
datetime_list = re.split('_|\.', yaml_file)
30-
file_year = datetime_list[0]
31-
file_month = datetime_list[1]
32-
file_day = datetime_list[2]
30+
file_year = int(datetime_list[0])
31+
file_month = int(datetime_list[1])
32+
file_day = int(datetime_list[2])
3333
if file_year in timeline:
3434
if file_month in timeline[file_year]:
3535
timeline[file_year][file_month][file_day] = link_to_post

blog/code_snippets/mitmproxy_k8s.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
---
32
apiVersion: apps/v1
43
kind: Deployment

templates/blog.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
<ol>
1111
{% for year in date_dict %}
1212
<li class="sidebar-section"> {{ year }} </li>
13-
{% for month in date_dict[year] %}
14-
{% for day in date_dict[year][month] %}
13+
{% for month in date_dict[year]|sort(reverse=True) %}
14+
{% for day in date_dict[year][month]|sort %}
1515
<li>
1616
<a href="{{ date_dict[year][month][day] }}">
1717
{{ month }}/{{ day }}

0 commit comments

Comments
 (0)