8.12
This commit is contained in:
1 parent
e86aebf49b
commit
0cd2776532
23 files changed
+371
-96
No files matched your search
@@ -9,6 +9,14 @@
|
||||
<div class="post">
|
||||
<div class="time">{{ .Date.Format "January 2, 2006" }}</div>
|
||||
<a href="{{ .Permalink }}">{{ .Title }}</a>
|
||||
<!-- 计算每篇文章的发布时间与当前时间的差值 -->
|
||||
{{ $publishDate := .Date }}
|
||||
{{ $currentTime := now }}
|
||||
{{ $timeDiff := div (sub $currentTime.Unix $publishDate.Unix) 3600 }}
|
||||
<!-- 判断发布时间是否小于 48 小时 -->
|
||||
{{ if lt $timeDiff 48 }}
|
||||
<span class="new-post-message"></span>
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ end }}
|
||||
</div>
|
||||
@@ -25,7 +33,6 @@
|
||||
<a class="prev" title="上一页" href="{{ $paginator.Prev.URL }}">上一页</a>
|
||||
{{ end }}
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
Reference in new issue
Block a user