web/tabs/archives.md
Cotes Chung 46c2cfe64e Improved the page recognition.
Useful for label localization
2020-06-30 17:39:14 +08:00

1.2 KiB

title type
Archives archives
{% for post in site.posts %} {% capture this_year %}{{ post.date | date: "%Y" }}{% endcapture %} {% capture pre_year %}{{ post.previous.date | date: "%Y" }}{% endcapture %} {% if forloop.first %} {% assign last_day = "" %} {% assign last_month = "" %} {{this_year}}
    {% endif %}
  • {% capture this_day %}{{ post.date | date: "%d" }}{% endcapture %} {% capture this_month %}{{ post.date | date: "%b" }}{% endcapture %} {{ this_day }} {{ this_month }} {{ post.title }}
  • {% if forloop.last %}
{% elsif this_year != pre_year %} {{pre_year}}
    {% assign last_day = "" %} {% assign last_month = "" %} {% endif %} {% endfor %}