-
{% for year in year_post_group %}
{# 遍历按年份分组的结果 #}
- {{ year.grouper }} {% trans 'year' %} {# 显示年份 #}
{% regroup year.list by pub_time.month as month_post_group %}
-
{% for month in month_post_group %} {# 遍历按月份分组的结果 #}
- {{ month.grouper }} {% trans 'month' %}
{# 显示月份,以及“月”的国际化翻译 #}
-
{% for article in month.list %}
- {{ article.title }} {# 显示文章标题,并设置链接到文章详情页 #} {% endfor %}
{% endfor %}
{% endfor %}
- {{ month.grouper }} {% trans 'month' %}
{# 显示月份,以及“月”的国际化翻译 #}
{# 主要内容区域,role属性表明其主要内容的角色 #}
{# 文章归档部分的头部容器 #}
{% trans 'article archive' %}
{# 显示“文章归档”的标题 #} {# 文章归档的内容区域 #}
{% regroup article_list by pub_time.year as year_post_group %} {# 将文章列表按发布时间的年份分组,结果保存到year_post_group #}