Files: 9e8c00eafa3d6d94f2b92037243fe07b6ba66aad / themes / ran / templates / period_archives.html
5113 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 | <ul> |
61 | {%- for article in articles | |
62 | selectattr("date", "lessthan", |
63 | dates[ dates | length - 1].date) -%} |
64 | {%- if loop.index == 1 -%} |
65 | {%- if period | length == 1 -%} |
66 | <li> |
67 | <a href="/{{- article.date | strftime('%Y') -}}" |
68 | rel="prev"> |
69 | <span> ← </span> |
70 | <time datetime="{{- article.date | |
71 | strftime('%Y') -}}"> |
72 | {{- article.date | |
73 | strftime(DATE_FORMAT_YEAR) -}} |
74 | </time> |
75 | </a> |
76 | </li> |
77 | {%- elif period | length == 2 -%} |
78 | <li> |
79 | <a href="/{{- article.date | strftime('%Y/%m') -}}" |
80 | rel="prev"> |
81 | <span> ← </span> |
82 | <time datetime="{{- article.date | |
83 | strftime('%Y-%m') -}}"> |
84 | {{- article.date | |
85 | strftime(DATE_FORMAT_MONTH) -}} |
86 | </time> |
87 | </a> |
88 | </li> |
89 | {%- else -%} |
90 | <li> |
91 | <a href="/{{- article.date | |
92 | strftime('%Y/%m/%d') -}}" |
93 | rel="prev"> |
94 | <span> ← </span> |
95 | <time datetime="{{- article.date | |
96 | strftime('%Y-%m-%d') -}}"> |
97 | {{- article.date | |
98 | strftime(DATE_FORMAT_DAY) -}} |
99 | </time> |
100 | </a> |
101 | </li> |
102 | {%- endif -%} |
103 | {%- endif -%} |
104 | {%- endfor -%} |
105 | {%- if period | length == 1 -%} |
106 | <li> |
107 | <a href="/entries" rel="up"> |
108 | <span> ↑ </span> |
109 | {{- ARCHIVES_TITLE -}} |
110 | </a> |
111 | </li> |
112 | {%- elif period | length == 2 -%} |
113 | <li> |
114 | <a href="/{{- dates[0].date | strftime('%Y') -}}" rel="up"> |
115 | <span> ↑ </span> |
116 | <time datetime="{{- dates[0].date | strftime('%Y') -}}"> |
117 | {{- dates[0].date | strftime(DATE_FORMAT_YEAR) -}} |
118 | </time> |
119 | </a> |
120 | </li> |
121 | {%- else -%} |
122 | <li> |
123 | <a href="/{{- dates[0].date | strftime('%Y/%m') -}}" |
124 | rel="up"> |
125 | <span> ↑ </span> |
126 | <time datetime="{{- dates[0].date | |
127 | strftime('%Y-%m') -}}"> |
128 | {{- dates[0].date | strftime(DATE_FORMAT_MONTH) -}} |
129 | </time> |
130 | </a> |
131 | </li> |
132 | {%- endif -%} |
133 | {%- for article in articles | |
134 | selectattr("date", "greaterthan", dates[0].date) | |
135 | reverse -%} |
136 | {%- if loop.index == 1 -%} |
137 | {%- if period | length == 1 -%} |
138 | <li> |
139 | <a href="/{{- article.date | strftime('%Y') -}}" |
140 | rel="next"> |
141 | <span> → </span> |
142 | <time datetime="{{- article.date | |
143 | strftime('%Y') -}}"> |
144 | {{- article.date | |
145 | strftime(DATE_FORMAT_YEAR) -}} |
146 | </time> |
147 | </a> |
148 | </li> |
149 | {%- elif period | length == 2 -%} |
150 | <li> |
151 | <a href="/{{- article.date | strftime('%Y/%m') -}}" |
152 | rel="next"> |
153 | <span> → </span> |
154 | <time datetime="{{- article.date | |
155 | strftime('%Y-%m') -}}"> |
156 | {{- article.date | |
157 | strftime(DATE_FORMAT_MONTH) -}} |
158 | </time> |
159 | </a> |
160 | </li> |
161 | {%- else -%} |
162 | <li> |
163 | <a href="/{{- article.date | |
164 | strftime('%Y/%m/%d') -}}" |
165 | rel="next"> |
166 | <span> → </span> |
167 | <time datetime="{{- article.date | |
168 | strftime('%Y-%m-%d') -}}"> |
169 | {{- article.date | |
170 | strftime(DATE_FORMAT_DAY) -}} |
171 | </time> |
172 | </a> |
173 | </li> |
174 | {%- endif -%} |
175 | {%- endif -%} |
176 | {%- endfor -%} |
177 | </ul> |
178 | </nav> |
179 | {{- super() -}} |
180 | {%- endblock -%} |
181 | |
182 |
Built with git-ssb-web