git ssb

0+

Grey the earthling / gkn.me.uk



Tree: 7d8fd049789a55f18b635411fc39a63fc09a4529

Files: 7d8fd049789a55f18b635411fc39a63fc09a4529 / themes / ran / templates / period_archives.html

4531 bytesRaw
1{%- extends "base.html" -%}
2{%- block title -%}
3 {# period is a string, but we want a date, so use an article's date. #}
4 {%- if period | length == 1 -%}
5 {{- dates[0].date | strftime(DATE_FORMAT_YEAR) -}}
6 {%- elif period | length == 2 -%}
7 {{- dates[0].date | strftime(DATE_FORMAT_MONTH) -}}
8 {%- else -%}
9 {{- dates[0].date | strftime(DATE_FORMAT_DAY) -}}
10 {%- endif -%}
11{%- endblock -%}
12{%- block pagedetails -%}
13 {{- super() -}}
14 {%- if period | length == 1 and
15 dates | unique(attribute="date.month") | list | length > 1 -%}
16 <section class="smalllinks">
17 <h2>Months:</h2>
18 <ul>
19 {%- for article in dates |
20 reverse |
21 unique(attribute="date.month") -%}
22 <li>
23 <a href="/{{- article.date | strftime('%Y/%m') -}}">
24 <time datetime="{{- article.date |
25 strftime('%Y-%m') -}}">
26 {{- article.date |
27 strftime(DATE_FORMAT_MONTH_OF_YEAR)
28 -}}
29 </time>
30 </a>
31 </li>
32 {%- endfor -%}
33 </ul>
34 </section>
35 {%- elif period | length == 2 and
36 dates | unique(attribute="date.day") | list | length > 1 -%}
37 <section class="smalllinks">
38 <h2>Days:</h2>
39 <ul>
40 {%- for article in dates |
41 reverse |
42 unique(attribute="date.day") -%}
43 <li>
44 <a href="/{{- article.date | strftime('%Y/%m/%d') -}}">
45 <time datetime="{{- article.date |
46 strftime('%Y-%m-%d') -}}">
47 {{- article.date |
48 strftime(DATE_FORMAT_DAY_OF_MONTH)
49 -}}
50 </time>
51 </a>
52 </li>
53 {%- endfor -%}
54 </ul>
55 </section>
56 {%- endif -%}
57{%- endblock -%}
58{%- block maincontent -%}
59 <nav class="nearby">
60 {%- if period | length == 1 -%}
61 <a href="/entries" rel="up">
62 <span></span>
63 {{- ARCHIVES_TITLE -}}
64 </a>
65 {%- elif period | length == 2 -%}
66 <a href="/{{- dates[0].date | strftime('%Y') -}}" rel="up">
67 <span></span>
68 <time datetime="{{- dates[0].date | strftime('%Y') -}}">
69 {{- dates[0].date | strftime(DATE_FORMAT_YEAR) -}}
70 </time>
71 </a>
72 {%- else -%}
73 <a href="/{{- dates[0].date | strftime('%Y/%m') -}}" rel="up">
74 <span></span>
75 <time datetime="{{- dates[0].date | strftime('%Y-%m') -}}">
76 {{- dates[0].date | strftime(DATE_FORMAT_MONTH) -}}
77 </time>
78 </a>
79 {%- endif -%}
80 {%- for article in articles |
81 selectattr("date", "greaterthan", dates[0].date) |
82 reverse -%}
83 {%- if loop.index == 1 -%}
84 {%- if period | length == 1 -%}
85 <a href="/{{- article.date | strftime('%Y') -}}" rel="next">
86 <span></span>
87 <time datetime="{{- article.date | strftime('%Y') -}}">
88 {{- article.date | strftime(DATE_FORMAT_YEAR) -}}
89 </time>
90 </a>
91 {%- elif period | length == 2 -%}
92 <a href="/{{- article.date | strftime('%Y/%m') -}}"
93 rel="next">
94 <span></span>
95 <time datetime="{{- article.date |
96 strftime('%Y-%m') -}}">
97 {{- article.date | strftime(DATE_FORMAT_MONTH) -}}
98 </time>
99 </a>
100 {%- else -%}
101 <a href="/{{- article.date | strftime('%Y/%m/%d') -}}"
102 rel="next">
103 <span></span>
104 <time datetime="{{- article.date |
105 strftime('%Y-%m-%d') -}}">
106 {{- article.date | strftime(DATE_FORMAT_DAY) -}}
107 </time>
108 </a>
109 {%- endif -%}
110 {%- endif -%}
111 {%- endfor -%}
112 {%- for article in articles |
113 selectattr("date", "lessthan", dates[ dates | length - 1].date) -%}
114 {%- if loop.index == 1 -%}
115 {%- if period | length == 1 -%}
116 <a href="/{{- article.date | strftime('%Y') -}}" rel="prev">
117 <span></span>
118 <time datetime="{{- article.date | strftime('%Y') -}}">
119 {{- article.date | strftime(DATE_FORMAT_YEAR) -}}
120 </time>
121 </a>
122 {%- elif period | length == 2 -%}
123 <a href="/{{- article.date | strftime('%Y/%m') -}}"
124 rel="prev">
125 <span></span>
126 <time datetime="{{- article.date |
127 strftime('%Y-%m') -}}">
128 {{- article.date | strftime(DATE_FORMAT_MONTH) -}}
129 </time>
130 </a>
131 {%- else -%}
132 <a href="/{{- article.date | strftime('%Y/%m/%d') -}}"
133 rel="prev">
134 <span></span>
135 <time datetime="{{- article.date |
136 strftime('%Y-%m-%d') -}}">
137 {{- article.date | strftime(DATE_FORMAT_DAY) -}}
138 </time>
139 </a>
140 {%- endif -%}
141 {%- endif -%}
142 {%- endfor -%}
143 </nav>
144 {{- super() -}}
145{%- endblock -%}
146
147

Built with git-ssb-web