加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
index.html 1.11 KB
一键复制 编辑 原始数据 按行查看 历史
TMaize 提交于 2020-07-19 13:26 . Squashed commit of the following:
---
layout: page
title: 首页
---
<div class="page page-index">
{% for post in site.posts -%}
{%- capture post_year %}{{ post.date | date: "%Y" }}{% endcapture -%}
{%- capture post_previous_year %}{{ post.previous.date | date: "%Y" }}{% endcapture -%}
{%- capture post_next_year %}{{ post.next.date | date: "%Y" }}{% endcapture -%}
{%- if forloop.first or post_next_year != post_year -%}
<div class="list-post">
<h2 id="{{post_year}}">{{post_year}}</h2>
<ul>
{%- endif %}
<li>
<span class="date">{{ post.date | date: "%Y/%m/%d" }}</span>
<div class="title">
<a href="{{ site.baseurl | append: post.url }}" class="hover-underline">{{ post.title }}</a>
</div>
<div class="categories">
{% for categorie in post.categories -%}
<a href="{{site.baseurl}}/pages/categories.html#{{ categorie }}" class="hover-underline">{{ categorie }}</a>
{%- endfor %}
</div>
</li>
{%- if forloop.last or post_previous_year != post_year %}
</ul>
</div>
{%- endif %}
{%- endfor %}
</div>
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化