Добавлено разбиение заметок по годам
This commit is contained in:
		| @@ -8,18 +8,33 @@ use: [articles] | ||||
|  | ||||
|   <h1>{{ page.title }}</h1> | ||||
|  | ||||
|   <ul> | ||||
|   {% for year in 2010..2030 %} | ||||
|  | ||||
|     {% set items = [] %} | ||||
|  | ||||
|     {% for article in data.articles %} | ||||
|       <li> | ||||
|         <p> | ||||
|           <a href="{{ article.url }}">{{ article.title }}</a> | ||||
|           {% if article.description %} | ||||
|             <br> | ||||
|             {{ article.description }} | ||||
|           {% endif %} | ||||
|         </p> | ||||
|       </li> | ||||
|       {% if article.date|date('Y') == year %} | ||||
|         {% set items = items|merge([article]) %} | ||||
|       {% endif %} | ||||
|     {% endfor %} | ||||
|   </ul> | ||||
|  | ||||
|     {% if items %} | ||||
|       <h2>{{ year }}</h2> | ||||
|       <ul> | ||||
|         {% for article in items %} | ||||
|           <li> | ||||
|             <p> | ||||
|               <a href="{{ article.url }}">{{ article.title }}</a> | ||||
|               {% if article.description %} | ||||
|                 <br> | ||||
|                 {{ article.description }} | ||||
|               {% endif %} | ||||
|             </p> | ||||
|           </li> | ||||
|         {% endfor %} | ||||
|       </ul> | ||||
|     {% endif %} | ||||
|  | ||||
|   {% endfor %} | ||||
|  | ||||
| {% endblock %} | ||||
|   | ||||
		Reference in New Issue
	
	Block a user