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